cryptoSignEd25519SkToCurve25519 static method
Implementation
static Uint8List cryptoSignEd25519SkToCurve25519(Uint8List ed25519Sk) {
RangeError.checkValueInInterval(
ed25519Sk.length,
cryptoSignEd25519Secretkeybytes,
cryptoSignEd25519Secretkeybytes,
'ed25519Sk',
'Invalid length');
final _curve25519Pk = calloc<Uint8>(cryptoScalarmultCurve25519Bytes);
final _ed25519Sk = ed25519Sk.toPointer();
try {
_cryptoSign
.crypto_sign_ed25519_sk_to_curve25519(_curve25519Pk, _ed25519Sk)
.mustSucceed('crypto_sign_ed25519_sk_to_curve25519');
return _curve25519Pk.toList(cryptoScalarmultCurve25519Bytes);
} finally {
calloc.free(_curve25519Pk);
calloc.free(_ed25519Sk);
}
}