uses
sgcCrypto_Random, sgcCrypto_AES, sgcCrypto_Keccak, sgcCrypto_Ed25519,
sgcCrypto_MLKEM;
var
vKey, vIV, vPlain, vAAD, vTag, vCipher: TBytes;
vDigest, vSeed, vSignature, vMessage: TBytes;
vPublicKey, vPrivateKey, vSharedSecret, vCiphertext: TBytes;
begin
vKey := sgcRandomBytes(32);
vIV := sgcRandomBytes(12);
vPlain := TEncoding.UTF8.GetBytes('confidential payload');
vCipher := sgcAES_GCM_Encrypt(vKey, vIV, vPlain, vAAD, vTag);
vDigest := sgcSHA3_256(vPlain);
vSeed := sgcRandomBytes(32);
vMessage := TEncoding.UTF8.GetBytes('sign me');
vSignature := sgcEd25519_Sign(vSeed, vMessage);
sgcMLKEM_GenerateKeyPair(mlkem768, vPublicKey, vPrivateKey);
sgcMLKEM_Encapsulate(mlkem768, vPublicKey, vCiphertext, vSharedSecret);
end;
TBytes vKey = sgcRandomBytes(32);
TBytes vIV = sgcRandomBytes(12);
TBytes vAAD, vTag;
TBytes vPlain = TEncoding::UTF8->GetBytes("confidential payload");
TBytes vCipher = sgcAES_GCM_Encrypt(vKey, vIV, vPlain, vAAD, vTag);
TBytes vDigest = sgcSHA3_256(vPlain);
TBytes vSeed = sgcRandomBytes(32);
TBytes vMessage = TEncoding::UTF8->GetBytes("sign me");
TBytes vSignature = sgcEd25519_Sign(vSeed, vMessage);
TBytes vPublicKey, vPrivateKey, vSharedSecret, vCiphertext;
sgcMLKEM_GenerateKeyPair(mlkem768, vPublicKey, vPrivateKey);
sgcMLKEM_Encapsulate(mlkem768, vPublicKey, vCiphertext, vSharedSecret);