Lines Matching refs:keylen

149     const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8;  in aesni_init_key()  local
151 if (keylen <= 0) { in aesni_init_key()
158 ret = aesni_set_decrypt_key(key, keylen, &dat->ks.ks); in aesni_init_key()
163 ret = aesni_set_encrypt_key(key, keylen, &dat->ks.ks); in aesni_init_key()
233 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8; in aesni_gcm_init_key() local
235 if (keylen <= 0) { in aesni_gcm_init_key()
239 aesni_set_encrypt_key(key, keylen, &gctx->ks.ks); in aesni_gcm_init_key()
278 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx); in aesni_xts_init_key() local
279 const int bytes = keylen / 2; in aesni_xts_init_key()
282 if (keylen <= 0) { in aesni_xts_init_key()
336 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8; in aesni_ccm_init_key() local
338 if (keylen <= 0) { in aesni_ccm_init_key()
342 aesni_set_encrypt_key(key, keylen, &cctx->ks.ks); in aesni_ccm_init_key()
370 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8; in aesni_ocb_init_key() local
372 if (keylen <= 0) { in aesni_ocb_init_key()
382 aesni_set_encrypt_key(key, keylen, &octx->ksenc.ks); in aesni_ocb_init_key()
383 aesni_set_decrypt_key(key, keylen, &octx->ksdec.ks); in aesni_ocb_init_key()
422 # define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ argument
423 static const EVP_CIPHER aesni_##keylen##_##mode = { \
424 nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \
432 static const EVP_CIPHER aes_##keylen##_##mode = { \
433 nid##_##keylen##_##nmode,blocksize, \
434 keylen/8,ivlen, \
442 const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
443 { return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
445 # define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags) \ argument
446 static const EVP_CIPHER aesni_##keylen##_##mode = { \
447 nid##_##keylen##_##mode,blocksize, \
448 …P_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE||EVP_CIPH_##MODE##_MODE==EVP_CIPH_SIV_MODE?2:1)*keylen/8, \
457 static const EVP_CIPHER aes_##keylen##_##mode = { \
458 nid##_##keylen##_##mode,blocksize, \
459 …P_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE||EVP_CIPH_##MODE##_MODE==EVP_CIPH_SIV_MODE?2:1)*keylen/8, \
468 const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
469 { return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; }
642 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx); in aes_t4_xts_init_key() local
643 const int bytes = keylen / 2; in aes_t4_xts_init_key()
646 if (keylen <= 0) { in aes_t4_xts_init_key()
752 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8; in aes_t4_ocb_init_key() local
754 if (keylen <= 0) { in aes_t4_ocb_init_key()
764 aes_t4_set_encrypt_key(key, keylen, &octx->ksenc.ks); in aes_t4_ocb_init_key()
765 aes_t4_set_decrypt_key(key, keylen, &octx->ksdec.ks); in aes_t4_ocb_init_key()
808 # define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ argument
809 static const EVP_CIPHER aes_t4_##keylen##_##mode = { \
810 nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \
818 static const EVP_CIPHER aes_##keylen##_##mode = { \
819 nid##_##keylen##_##nmode,blocksize, \
820 keylen/8,ivlen, \
828 const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
829 { return SPARC_AES_CAPABLE?&aes_t4_##keylen##_##mode:&aes_##keylen##_##mode; }
831 # define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags) \ argument
832 static const EVP_CIPHER aes_t4_##keylen##_##mode = { \
833 nid##_##keylen##_##mode,blocksize, \
834 …P_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE||EVP_CIPH_##MODE##_MODE==EVP_CIPH_SIV_MODE?2:1)*keylen/8, \
843 static const EVP_CIPHER aes_##keylen##_##mode = { \
844 nid##_##keylen##_##mode,blocksize, \
845 …P_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE||EVP_CIPH_##MODE##_MODE==EVP_CIPH_SIV_MODE?2:1)*keylen/8, \
854 const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
855 { return SPARC_AES_CAPABLE?&aes_t4_##keylen##_##mode:&aes_##keylen##_##mode; }
1024 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx); in s390x_aes_ecb_init_key() local
1026 if (keylen <= 0) { in s390x_aes_ecb_init_key()
1030 cctx->fc = S390X_AES_FC(keylen); in s390x_aes_ecb_init_key()
1034 memcpy(cctx->km.param.k, key, keylen); in s390x_aes_ecb_init_key()
1053 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx); in s390x_aes_ofb_init_key() local
1056 if (keylen <= 0) { in s390x_aes_ofb_init_key()
1065 memcpy(cctx->kmo.param.k, key, keylen); in s390x_aes_ofb_init_key()
1066 cctx->fc = S390X_AES_FC(keylen); in s390x_aes_ofb_init_key()
1119 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx); in s390x_aes_cfb_init_key() local
1122 if (keylen <= 0) { in s390x_aes_cfb_init_key()
1130 cctx->fc = S390X_AES_FC(keylen); in s390x_aes_cfb_init_key()
1136 memcpy(cctx->kmf.param.k, key, keylen); in s390x_aes_cfb_init_key()
1144 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx); in s390x_aes_cfb_cipher() local
1152 if (keylen <= 0) { in s390x_aes_cfb_cipher()
1183 S390X_AES_FC(keylen), cctx->kmf.param.k); in s390x_aes_cfb_cipher()
1204 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx); in s390x_aes_cfb8_init_key() local
1207 if (keylen <= 0) { in s390x_aes_cfb8_init_key()
1215 cctx->fc = S390X_AES_FC(keylen); in s390x_aes_cfb8_init_key()
1221 memcpy(cctx->kmf.param.k, key, keylen); in s390x_aes_cfb8_init_key()
1609 int keylen; in s390x_aes_gcm_init_key() local
1615 keylen = EVP_CIPHER_CTX_get_key_length(ctx); in s390x_aes_gcm_init_key()
1616 if (keylen <= 0) { in s390x_aes_gcm_init_key()
1621 memcpy(&gctx->kma.param.k, key, keylen); in s390x_aes_gcm_init_key()
1623 gctx->fc = S390X_AES_FC(keylen); in s390x_aes_gcm_init_key()
2020 int keylen; in s390x_aes_ccm_init_key() local
2026 keylen = EVP_CIPHER_CTX_get_key_length(ctx); in s390x_aes_ccm_init_key()
2027 if (keylen <= 0) { in s390x_aes_ccm_init_key()
2032 cctx->aes.ccm.fc = S390X_AES_FC(keylen); in s390x_aes_ccm_init_key()
2033 memcpy(cctx->aes.ccm.kmac_param.k, key, keylen); in s390x_aes_ccm_init_key()
2285 # define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode, \ argument
2287 static const EVP_CIPHER s390x_aes_##keylen##_##mode = { \
2288 nid##_##keylen##_##nmode,blocksize, \
2289 keylen / 8, \
2302 static const EVP_CIPHER aes_##keylen##_##mode = { \
2303 nid##_##keylen##_##nmode, \
2305 keylen / 8, \
2318 const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
2320 return S390X_aes_##keylen##_##mode##_CAPABLE ? \
2321 &s390x_aes_##keylen##_##mode : &aes_##keylen##_##mode; \
2324 # define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags)\ argument
2325 static const EVP_CIPHER s390x_aes_##keylen##_##mode = { \
2326 nid##_##keylen##_##mode, \
2328 …_MODE==EVP_CIPH_XTS_MODE||EVP_CIPH_##MODE##_MODE==EVP_CIPH_SIV_MODE ? 2 : 1) * keylen / 8, \
2341 static const EVP_CIPHER aes_##keylen##_##mode = { \
2342 nid##_##keylen##_##mode,blocksize, \
2343 …_MODE==EVP_CIPH_XTS_MODE||EVP_CIPH_##MODE##_MODE==EVP_CIPH_SIV_MODE ? 2 : 1) * keylen / 8, \
2356 const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
2358 return S390X_aes_##keylen##_##mode##_CAPABLE ? \
2359 &s390x_aes_##keylen##_##mode : &aes_##keylen##_##mode; \
2364 # define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ argument
2365 static const EVP_CIPHER aes_##keylen##_##mode = { \
2366 nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \
2374 const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
2375 { return &aes_##keylen##_##mode; }
2377 # define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags) \ argument
2378 static const EVP_CIPHER aes_##keylen##_##mode = { \
2379 nid##_##keylen##_##mode,blocksize, \
2380 …P_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE||EVP_CIPH_##MODE##_MODE==EVP_CIPH_SIV_MODE?2:1)*keylen/8, \
2389 const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \
2390 { return &aes_##keylen##_##mode; }
2394 #define BLOCK_CIPHER_generic_pack(nid,keylen,flags) \ argument
2395 BLOCK_CIPHER_generic(nid,keylen,16,16,cbc,cbc,CBC,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
2396 BLOCK_CIPHER_generic(nid,keylen,16,0,ecb,ecb,ECB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
2397 BLOCK_CIPHER_generic(nid,keylen,1,16,ofb128,ofb,OFB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
2398 BLOCK_CIPHER_generic(nid,keylen,1,16,cfb128,cfb,CFB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \
2399 BLOCK_CIPHER_generic(nid,keylen,1,16,cfb1,cfb1,CFB,flags) \
2400 BLOCK_CIPHER_generic(nid,keylen,1,16,cfb8,cfb8,CFB,flags) \
2401 BLOCK_CIPHER_generic(nid,keylen,1,16,ctr,ctr,CTR,flags)
2408 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8; in aes_init_key() local
2410 if (keylen <= 0) { in aes_init_key()
2420 ret = HWAES_set_decrypt_key(key, keylen, &dat->ks.ks); in aes_init_key()
2431 ret = AES_set_decrypt_key(key, keylen, &dat->ks.ks); in aes_init_key()
2438 ret = vpaes_set_decrypt_key(key, keylen, &dat->ks.ks); in aes_init_key()
2445 ret = AES_set_decrypt_key(key, keylen, &dat->ks.ks); in aes_init_key()
2453 ret = HWAES_set_encrypt_key(key, keylen, &dat->ks.ks); in aes_init_key()
2471 ret = AES_set_encrypt_key(key, keylen, &dat->ks.ks); in aes_init_key()
2478 ret = vpaes_set_encrypt_key(key, keylen, &dat->ks.ks); in aes_init_key()
2485 ret = AES_set_encrypt_key(key, keylen, &dat->ks.ks); in aes_init_key()
2797 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8; in aes_gcm_init_key() local
2799 if (keylen <= 0) { in aes_gcm_init_key()
2806 HWAES_set_encrypt_key(key, keylen, &gctx->ks.ks); in aes_gcm_init_key()
2819 AES_set_encrypt_key(key, keylen, &gctx->ks.ks); in aes_gcm_init_key()
2828 vpaes_set_encrypt_key(key, keylen, &gctx->ks.ks); in aes_gcm_init_key()
2837 AES_set_encrypt_key(key, keylen, &gctx->ks.ks); in aes_gcm_init_key()
3229 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx); in aes_xts_init_key() local
3230 const int bytes = keylen / 2; in aes_xts_init_key()
3233 if (keylen <= 0) { in aes_xts_init_key()
3487 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8; in aes_ccm_init_key() local
3489 if (keylen <= 0) { in aes_ccm_init_key()
3496 HWAES_set_encrypt_key(key, keylen, &cctx->ks.ks); in aes_ccm_init_key()
3507 vpaes_set_encrypt_key(key, keylen, &cctx->ks.ks); in aes_ccm_init_key()
3515 AES_set_encrypt_key(key, keylen, &cctx->ks.ks); in aes_ccm_init_key()
3677 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8; in aes_wrap_init_key() local
3679 if (keylen <= 0) { in aes_wrap_init_key()
3684 AES_set_encrypt_key(key, keylen, &wctx->ks.ks); in aes_wrap_init_key()
3686 AES_set_decrypt_key(key, keylen, &wctx->ks.ks); in aes_wrap_init_key()
3919 const int keylen = EVP_CIPHER_CTX_get_key_length(ctx) * 8; in aes_ocb_init_key() local
3921 if (keylen <= 0) { in aes_ocb_init_key()
3933 HWAES_set_encrypt_key(key, keylen, &octx->ksenc.ks); in aes_ocb_init_key()
3934 HWAES_set_decrypt_key(key, keylen, &octx->ksdec.ks); in aes_ocb_init_key()
3947 vpaes_set_encrypt_key(key, keylen, &octx->ksenc.ks); in aes_ocb_init_key()
3948 vpaes_set_decrypt_key(key, keylen, &octx->ksdec.ks); in aes_ocb_init_key()
3958 AES_set_encrypt_key(key, keylen, &octx->ksenc.ks); in aes_ocb_init_key()
3959 AES_set_decrypt_key(key, keylen, &octx->ksdec.ks); in aes_ocb_init_key()