RedPallasPrivateKey.fromBytes constructor

RedPallasPrivateKey.fromBytes(
  1. List<int> bytes,
  2. PallasPoint generator
)

Implementation

factory RedPallasPrivateKey.fromBytes(
  List<int> bytes,
  PallasPoint generator,
) {
  final point = VestaFq.fromBytes(bytes);
  final mul = generator * point;
  final pointBytes = mul.toBytes();
  return RedPallasPrivateKey(
    sk: bytes,
    publicKey: RedPallasPublicKey(
      publicKey: pointBytes,
      point: PallasNativePoint.fromBytes(pointBytes),
    ),
  );
}