Expand description
AES-GCM256 cryptography primitives for encrypting and decrypting data in the HydraSync protocol.
Constants§
Functions§
- decrypt_
data - Decrypt
datathat was encrypted withencrypt_data, returns the original plaintext or an error if decryption fails. - decrypt_
into - Decrypt
input(which should be in the format produced byencrypt_into) intooutputusing AES-256-GCM with the provided 32-bytekey. Theoutputbuffer must beinput.len() - NONCE_LEN - TAG_LENbytes, returns the number of bytes written tooutput(the length of the decrypted plaintext) or an error if decryption fails. - encrypt_
data - Encrypt
datawith a 32-bytekeyusing AES-256-GCM, returns a byte vector containing the nonce, ciphertext, and tag or an error if encryption fails. - encrypt_
into - Encrypt
inputintooutputusing AES-256-GCM with the provided 32-bytekey. Theoutputbuffer must be at leastinput.len() + NONCE_LEN + TAG_LENbytes long, returns the total number of bytes written tooutput(nonce + ciphertext + tag) or an error if encryption fails. - generate_
x25519_ keypair - Generates and returns a new X25519 keypair (private_key, public_key)