scalarMultBase static method

X25519Keypair scalarMultBase(
  1. List<int> scalar
)

Perform scalar multiplication with the base point (u = 9). Returns the X25519 keypair.

Implementation

static X25519Keypair scalarMultBase(List<int> scalar) {
  if (scalar.length != X25519KeyConst.privateKeyLength) {
    throw CryptoException('invalid scalar bytes length');
  }
  final clamped = _clampScalar(scalar);
  final pk = _montgomeryLadder(clamped, X25519KeyConst.baseU);
  return X25519Keypair._(privateKey: clamped, publicKey: pk);
}