normalizePublicKey method

  1. @override
BuBytes? normalizePublicKey(
  1. List<int> publicKey
)
override

Validates 32-byte publicKey (33-byte 0xed-prefixed form accepted) and returns its canonical 32-byte base encoding, or null when invalid (bad length, prefix, range, curve membership, or identity).

Implementation

@override
BuBytes? normalizePublicKey(List<int> publicKey) {
  // Pure validation: identical math on every backend (Dart decoders are
  // pinned equal to Rust by the api-comparison tests), so no FFI
  // round-trip and no new Rust exports are needed.
  final r = api.normalizePublicKey(publicKey.asBytes);
  if (!r.isOk) return null;
  return r.value;
}