uses
sgcCrypto_Random, sgcCrypto_AES, sgcCrypto_Keccak;
var
vKey, vIV, vPlain, vAAD, vTag, vCipher, vDigest: 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);
vPlain := sgcAES_GCM_Decrypt(vKey, vIV, vCipher, vAAD, vTag);
end;
uses
sgcCrypto_Random, sgcCrypto_Ed25519, sgcCrypto_MLKEM;
var
vSeed, vMessage, vSignature: TBytes;
vPublicKey, vPrivateKey, vCiphertext, vSharedSecret: TBytes;
begin
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);
sgcMLKEM_Decapsulate(mlkem768, vPrivateKey, vCiphertext, vSharedSecret);
end;