SaplingExpandedSpendingKey.fromSpendingKey constructor

SaplingExpandedSpendingKey.fromSpendingKey(
  1. List<int> sk
)

Implementation

factory SaplingExpandedSpendingKey.fromSpendingKey(List<int> sk) {
  final ask = RedJubJubSpendPrivateKey.fromSpendingKey(sk);
  final nsk = blockchainUtils.api.jubjub.scReduce64(
    PrfExpand.saplingNsk.apply(sk),
  );
  final ovk = PrfExpand.saplingOvk.apply(sk).sublist(0, 32);
  return SaplingExpandedSpendingKey(
    ask: ask,
    nsk: JubJubFr.fromBytes(nsk),
    ovk: SaplingOutgoingViewingKey(ovk),
  );
}