SaplingExpandedSpendingKey.fromBytes constructor
SaplingExpandedSpendingKey.fromBytes(
- List<int> bytes
)
Implementation
factory SaplingExpandedSpendingKey.fromBytes(List<int> bytes) {
bytes = bytes.exc(
operation: "SaplingExpandedSpendingKey",
name: "bytes",
reason: "Invalid sapling extended spending key bytes length.",
length: 96,
);
// Single validating parse of the scalar; afterwards raw bytes are kept.
final nsk = JubJubFr.fromBytes(bytes.sublist(32, 64));
final self = SaplingExpandedSpendingKey(
ask: RedJubJubSpendPrivateKey.fromBytes(bytes.sublist(0, 32)),
nsk: nsk,
ovk: SaplingOutgoingViewingKey(bytes.sublist(64)),
);
self._nsk = nsk;
return self;
}