generateMlKem768KeyPair static method
Generates an ML-KEM-768 key pair for post-quantum key encapsulation.
Backed by the pure-Dart ML-KEM-768 implementation (via package:pqcrypto).
Raw 1184-byte public key and 2400-byte secret key are base64-encoded.
Persisted ML-KEM keys must always be used with the pure-Dart algorithm
— the FFI backend returns opaque process-lifetime handles instead of
real bytes.
Implementation
static Future<AtMlKem768KeyPair> generateMlKem768KeyPair() async {
final (publicKey: Uint8List pub, secretKey: Uint8List sk) =
await MlKem768PureDartAlgo.instance.generateKeyPair();
return AtMlKem768KeyPair.create(base64Encode(pub), base64Encode(sk));
}