9 aes_xts_encrypt, aes_xts_decrypt, \
11 aesgcm_setiv, aesgcm_encrypt, aesgcm_decrypt \
12 - advanced encryption standard (rijndael)
20 .B #include <libsec.h>
26 void aes_encrypt(ulong rk[], int Nr, uchar pt[16], uchar ct[16])
29 void aes_decrypt(ulong rk[], int Nr, uchar ct[16], uchar pt[16])
32 void setupAESstate(AESstate *s, uchar key[], int nkey, uchar *ivec)
35 void aesCBCencrypt(uchar *p, int len, AESstate *s)
38 void aesCBCdecrypt(uchar *p, int len, AESstate *s)
41 void aesCFBencrypt(uchar *p, int len, AESstate *s)
44 void aesCFBdecrypt(uchar *p, int len, AESstate *s)
47 void aesOFBencrypt(uchar *p, int len, AESstate *s)
50 void aes_xts_encrypt(AESstate *tweak, AESstate *ecb, uvlong sectorNumber, uchar *input, uchar *output, ulong len)
53 void aes_xts_decrypt(AESstate *tweak, AESstate *ecb, uvlong sectorNumber, uchar *input, uchar *output, ulong len)
56 void setupAESGCMstate(AESGCMstate *s, uchar *key, int keylen, uchar *iv, int ivlen)
59 void aesgcm_setiv(AESGCMstate *s, uchar *iv, int ivlen)
62 void aesgcm_encrypt(uchar *dat, ulong ndat, uchar *aad, ulong naad, uchar tag[16], AESGCMstate *s)
65 int aesgcm_decrypt(uchar *dat, ulong ndat, uchar *aad, ulong naad, uchar tag[16], AESGCMstate *s)
67 AES (a.k.a. Rijndael) has replaced DES as the preferred
72 are the block ciphers, corresponding to
78 implement cipher-block-chaining encryption.
83 implement cipher-feedback- and output-feedback-mode
84 stream cipher encryption.
88 implement the XTS-AES tweakable block cipher, per IEEE 1619-2017 (see bugs below).
90 is used to initialize the state of the above encryption modes.
91 The expanded roundkey parameters
103 with the corresponding number of rounds in
104 .IR AESstate.rounds .
105 .IR SetupAESGCMstate ,
110 implement Galois/Counter Mode (GCM) authenticated encryption with associated data (AEAD).
111 Before encryption or decryption, a new initialization vector (nonce) has to be set with
120 Aesgcm_decrypt returns zero when authentication and decryption where successfull and
122 All ciphering is performed in place.
125 should be 16, 24, or 32.
126 The initialization vector
130 bytes should be random enough to be unlikely to be reused
131 but does not need to be
132 cryptographically strongly unpredictable.
150 .B http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
152 Because of the way that non-multiple-of-16 buffers are handled,
154 must be fed buffers of the same size as the
156 calls that encrypted it.
162 abort on a non-multiple-of-16 length as ciphertext stealing