Lines Matching defs:key
79 } ks; /* AES key schedule to use */
80 int key_set; /* Set if key initialised */
95 } ks1, ks2; /* AES key schedules to use */
107 } ks; /* AES key schedule to use */
108 int key_set; /* Set if key initialised */
121 AES_KEY *key);
123 AES_KEY *key);
126 const AES_KEY *key);
128 const AES_KEY *key);
133 const AES_KEY *key, unsigned char *ivec, int enc);
137 size_t length, const AES_KEY *key,
140 size_t len, const AES_KEY *key,
151 size_t blocks, const AES_KEY *key,
198 AES_KEY *key);
200 AES_KEY *key);
203 const AES_KEY *key);
205 const AES_KEY *key);
209 size_t length, const AES_KEY *key, int enc);
213 const AES_KEY *key, unsigned char *ivec, int enc);
218 const void *key, const unsigned char *ivec);
235 const void *key,
242 const void *key,
250 const void *key, unsigned char ivec[16], u64 *Xi);
255 const void *key, unsigned char ivec[16], u64 *Xi);
266 static int aesni_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
275 ret = aesni_set_decrypt_key(key, ctx->key_len * 8, ctx->cipher_data);
280 ret = aesni_set_encrypt_key(key, ctx->key_len * 8, ctx->cipher_data);
339 static int aesni_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
343 if (!iv && !key)
345 if (key) {
346 aesni_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks);
360 /* If key set use IV, otherwise copy */
375 static int aesni_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
379 if (!iv && !key)
382 if (key) {
385 aesni_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks);
389 aesni_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks);
394 aesni_set_encrypt_key(key + ctx->key_len / 2,
413 static int aesni_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
417 if (!iv && !key)
419 if (key) {
420 aesni_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks.ks);
489 void aes_t4_set_encrypt_key(const unsigned char *key, int bits, AES_KEY *ks);
490 void aes_t4_set_decrypt_key(const unsigned char *key, int bits, AES_KEY *ks);
492 const AES_KEY *key);
494 const AES_KEY *key);
498 * resources. Loading as much key material to registers allows to
501 * non-key-length specific routines would require conditional branches
504 * by multiple key-length specfic subroutines, so why fight?
507 size_t len, const AES_KEY *key,
510 size_t len, const AES_KEY *key,
513 size_t len, const AES_KEY *key,
516 size_t len, const AES_KEY *key,
519 size_t len, const AES_KEY *key,
522 size_t len, const AES_KEY *key,
525 size_t blocks, const AES_KEY *key,
528 size_t blocks, const AES_KEY *key,
531 size_t blocks, const AES_KEY *key,
546 static int aes_t4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
557 aes_t4_set_decrypt_key(key, bits, ctx->cipher_data);
577 aes_t4_set_encrypt_key(key, bits, ctx->cipher_data);
645 static int aes_t4_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
649 if (!iv && !key)
651 if (key) {
653 aes_t4_set_encrypt_key(key, bits, &gctx->ks.ks);
680 /* If key set use IV, otherwise copy */
695 static int aes_t4_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
699 if (!iv && !key)
702 if (key) {
707 aes_t4_set_encrypt_key(key, bits, &xctx->ks1.ks);
725 aes_t4_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks);
744 aes_t4_set_encrypt_key(key + ctx->key_len / 2,
763 static int aes_t4_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
767 if (!iv && !key)
769 if (key) {
771 aes_t4_set_encrypt_key(key, bits, &cctx->ks.ks);
896 AES_KEY *key);
898 AES_KEY *key);
900 const AES_KEY *key);
902 const AES_KEY *key);
904 size_t length, const AES_KEY *key,
907 size_t len, const AES_KEY *key,
920 static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
931 ret = HWAES_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
942 ret = AES_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
949 ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
956 ret = AES_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
963 ret = HWAES_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
981 ret = AES_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
988 ret = vpaes_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
995 ret = AES_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks);
1253 if (gctx->gcm.key) {
1254 if (gctx->gcm.key != &gctx->ks)
1256 gctx_out->gcm.key = &gctx_out->ks;
1275 static int aes_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
1279 if (!iv && !key)
1281 if (key) {
1285 HWAES_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks);
1298 AES_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks);
1307 vpaes_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks);
1316 AES_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks);
1337 /* If key set use IV, otherwise copy */
1389 gctx->gcm.key,
1407 gctx->gcm.key,
1430 gctx->gcm.key,
1448 gctx->gcm.key,
1502 gctx->gcm.key, gctx->gcm.Yi.c,
1524 gctx->gcm.key, gctx->gcm.Yi.c,
1546 gctx->gcm.key,
1568 gctx->gcm.key,
1632 /* key1 and key2 are used as an indicator both key and IV are set */
1638 static int aes_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
1642 if (!iv && !key)
1645 if (key)
1656 HWAES_set_encrypt_key(key, ctx->key_len * 4,
1660 HWAES_set_decrypt_key(key, ctx->key_len * 4,
1665 HWAES_set_encrypt_key(key + ctx->key_len / 2,
1681 vpaes_set_encrypt_key(key, ctx->key_len * 4,
1685 vpaes_set_decrypt_key(key, ctx->key_len * 4,
1690 vpaes_set_encrypt_key(key + ctx->key_len / 2,
1701 AES_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks);
1704 AES_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1.ks);
1708 AES_set_encrypt_key(key + ctx->key_len / 2,
1798 if (cctx->ccm.key) {
1799 if (cctx->ccm.key != &cctx->ks)
1801 cctx_out->ccm.key = &cctx_out->ks;
1812 static int aes_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
1816 if (!iv && !key)
1818 if (key)
1822 HWAES_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks.ks);
1833 vpaes_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks.ks);
1841 AES_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks.ks);