Lines Matching refs:aes
29 static void aes_ccm_auth_start(void *aes, size_t M, size_t L, const u8 *nonce, in aes_ccm_auth_start() argument
45 aes_encrypt(aes, b, x); /* X_1 = E(K, B_0) */ in aes_ccm_auth_start()
55 aes_encrypt(aes, aad_buf, x); /* X_2 = E(K, X_1 XOR B_1) */ in aes_ccm_auth_start()
60 aes_encrypt(aes, &aad_buf[AES_BLOCK_SIZE], x); in aes_ccm_auth_start()
65 static void aes_ccm_auth(void *aes, const u8 *data, size_t len, u8 *x) in aes_ccm_auth() argument
74 aes_encrypt(aes, x, x); in aes_ccm_auth()
80 aes_encrypt(aes, x, x); in aes_ccm_auth()
93 static void aes_ccm_encr(void *aes, size_t L, const u8 *in, size_t len, u8 *out, in aes_ccm_encr() argument
103 aes_encrypt(aes, a, out); in aes_ccm_encr()
110 aes_encrypt(aes, a, out); in aes_ccm_encr()
118 static void aes_ccm_encr_auth(void *aes, size_t M, u8 *x, u8 *a, u8 *auth) in aes_ccm_encr_auth() argument
126 aes_encrypt(aes, a, tmp); in aes_ccm_encr_auth()
133 static void aes_ccm_decr_auth(void *aes, size_t M, u8 *a, const u8 *auth, u8 *t) in aes_ccm_decr_auth() argument
141 aes_encrypt(aes, a, tmp); in aes_ccm_decr_auth()
154 void *aes; in aes_ccm_ae() local
160 aes = aes_encrypt_init(key, key_len); in aes_ccm_ae()
161 if (aes == NULL) in aes_ccm_ae()
164 aes_ccm_auth_start(aes, M, L, nonce, aad, aad_len, plain_len, x); in aes_ccm_ae()
165 aes_ccm_auth(aes, plain, plain_len, x); in aes_ccm_ae()
169 aes_ccm_encr(aes, L, plain, plain_len, crypt, a); in aes_ccm_ae()
170 aes_ccm_encr_auth(aes, M, x, a, auth); in aes_ccm_ae()
172 aes_encrypt_deinit(aes); in aes_ccm_ae()
184 void *aes; in aes_ccm_ad() local
191 aes = aes_encrypt_init(key, key_len); in aes_ccm_ad()
192 if (aes == NULL) in aes_ccm_ad()
197 aes_ccm_decr_auth(aes, M, a, auth, t); in aes_ccm_ad()
200 aes_ccm_encr(aes, L, crypt, crypt_len, plain, a); in aes_ccm_ad()
202 aes_ccm_auth_start(aes, M, L, nonce, aad, aad_len, crypt_len, x); in aes_ccm_ad()
203 aes_ccm_auth(aes, plain, crypt_len, x); in aes_ccm_ad()
205 aes_encrypt_deinit(aes); in aes_ccm_ad()