Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions AeadEncryptionContext.decrypt

1
2
3
4
5
6
7
8
module juptune.crypto.aead;

Result decrypt(
    ubyte[] cipherText, 
    ubyte[] additionalData, 
    SecureMemory. outPlainText, 
    SecureMemory. outPlainTextSlice
);

Documentation

Decrypts the given cipherTextinto the outPlainTextbuffer, using the given additionalDatato calculate the authentication tag, and returns a slice outPlainTextwhich contains the final decrypted plaintext.

Assertions

cipherTextmust be at least AeadAlgorithmT.ABYTESin length. Where ABYTES is typically the length of the authentication tag.

outPlainTextmust be at least cipherText.length - AeadAlgorithmT.ABYTESin length.

Notes

This is a "combined" AEAD decryption, where the authentication tag is assumed to be appended to the ciphertext.

Params

Throws

Anything that AeadAlgorithmT.decryptthrows.

Returns

A Resultthat indicates if the decryption was successful or not.