deriveHardJunction method

Uint8List deriveHardJunction(
  1. List<int> seed,
  2. List<int> junction, {
  3. Uint8List? output,
})

Derive a single hard junction.

Implementation

Uint8List deriveHardJunction(List<int> seed, List<int> junction,
    {Uint8List? output}) {
  final bytes = ByteOutput();
  StrCodec.codec.encodeTo('Ed25519HDKD', bytes);
  U8ArrayCodec(super.seedSize).encodeTo(seed, bytes);
  U8ArrayCodec(junction.length).encodeTo(junction, bytes);
  final digest = Blake2bDigest(digestSize: 32);
  final jose = bytes.toBytes();
  digest.update(jose, 0, jose.length);
  output ??= Uint8List(32);
  digest.doFinal(output, 0);
  return output;
}