Lines Matching refs:ivlen
53 int ivlen; /* IV length */ member
114 int ivlen; /* IV length */ member
248 CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); in aesni_gcm_init_key()
255 CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); in aesni_gcm_init_key()
257 memcpy(gctx->iv, iv, gctx->ivlen); in aesni_gcm_init_key()
400 if (CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen) in aesni_ocb_init_key()
409 CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen); in aesni_ocb_init_key()
411 memcpy(octx->iv, iv, octx->ivlen); in aesni_ocb_init_key()
422 # define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ argument
424 nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \
434 keylen/8,ivlen, \
445 # define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags) \ argument
449 ivlen, \
460 ivlen, \
612 CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); in aes_t4_gcm_init_key()
619 CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); in aes_t4_gcm_init_key()
621 memcpy(gctx->iv, iv, gctx->ivlen); in aes_t4_gcm_init_key()
781 if (CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen) in aes_t4_ocb_init_key()
790 CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen); in aes_t4_ocb_init_key()
792 memcpy(octx->iv, iv, octx->ivlen); in aes_t4_ocb_init_key()
808 # define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ argument
810 nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \
820 keylen/8,ivlen, \
831 # define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags) \ argument
835 ivlen, \
846 ivlen, \
938 int ivlen; member
1054 const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx); in s390x_aes_ofb_init_key() local
1060 if (ivlen <= 0) { in s390x_aes_ofb_init_key()
1064 memcpy(cctx->kmo.param.cv, iv, ivlen); in s390x_aes_ofb_init_key()
1074 const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx); in s390x_aes_ofb_cipher() local
1079 memcpy(cctx->kmo.param.cv, iv, ivlen); in s390x_aes_ofb_cipher()
1108 memcpy(iv, cctx->kmo.param.cv, ivlen); in s390x_aes_ofb_cipher()
1120 const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx); in s390x_aes_cfb_init_key() local
1126 if (ivlen <= 0) { in s390x_aes_cfb_init_key()
1135 memcpy(cctx->kmf.param.cv, iv, ivlen); in s390x_aes_cfb_init_key()
1146 const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx); in s390x_aes_cfb_cipher() local
1156 if (ivlen <= 0) { in s390x_aes_cfb_cipher()
1160 memcpy(cctx->kmf.param.cv, iv, ivlen); in s390x_aes_cfb_cipher()
1193 memcpy(iv, cctx->kmf.param.cv, ivlen); in s390x_aes_cfb_cipher()
1205 const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx); in s390x_aes_cfb8_init_key() local
1211 if (ivlen <= 0) { in s390x_aes_cfb8_init_key()
1220 memcpy(cctx->kmf.param.cv, iv, ivlen); in s390x_aes_cfb8_init_key()
1229 const int ivlen = EVP_CIPHER_CTX_get_iv_length(ctx); in s390x_aes_cfb8_cipher() local
1232 memcpy(cctx->kmf.param.cv, iv, ivlen); in s390x_aes_cfb8_cipher()
1234 memcpy(iv, cctx->kmf.param.cv, ivlen); in s390x_aes_cfb8_cipher()
1412 if (ctx->ivlen == 12) { in s390x_aes_gcm_setiv()
1413 memcpy(&ctx->kma.param.j0, iv, ctx->ivlen); in s390x_aes_gcm_setiv()
1418 memcpy(ctx->iv, iv, ctx->ivlen); in s390x_aes_gcm_setiv()
1419 s390x_kma(ctx->iv, S390X_gcm_ivpadlen(ctx->ivlen), NULL, 0, NULL, in s390x_aes_gcm_setiv()
1442 int ivlen, enc, len; in s390x_aes_gcm_ctrl() local
1446 ivlen = EVP_CIPHER_get_iv_length(c->cipher); in s390x_aes_gcm_ctrl()
1449 gctx->ivlen = ivlen; in s390x_aes_gcm_ctrl()
1457 *(int *)ptr = gctx->ivlen; in s390x_aes_gcm_ctrl()
1468 if (gctx->ivlen == 12 || len > S390X_gcm_ivpadlen(gctx->ivlen)) { in s390x_aes_gcm_ctrl()
1479 gctx->ivlen = arg; in s390x_aes_gcm_ctrl()
1503 memcpy(gctx->iv, ptr, gctx->ivlen); in s390x_aes_gcm_ctrl()
1511 if ((arg < 4) || (gctx->ivlen - arg) < 8) in s390x_aes_gcm_ctrl()
1518 if (enc && RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0) in s390x_aes_gcm_ctrl()
1530 if (arg <= 0 || arg > gctx->ivlen) in s390x_aes_gcm_ctrl()
1531 arg = gctx->ivlen; in s390x_aes_gcm_ctrl()
1533 memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg); in s390x_aes_gcm_ctrl()
1538 ctr64_inc(gctx->iv + gctx->ivlen - 8); in s390x_aes_gcm_ctrl()
1547 memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg); in s390x_aes_gcm_ctrl()
1587 len = S390X_gcm_ivpadlen(gctx->ivlen); in s390x_aes_gcm_ctrl()
1639 memcpy(gctx->iv, iv, gctx->ivlen); in s390x_aes_gcm_init_key()
2285 # define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode, \ argument
2290 ivlen, \
2306 ivlen, \
2324 # define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags)\ argument
2329 ivlen, \
2344 ivlen, \
2364 # define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ argument
2366 nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \
2377 # define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags) \ argument
2381 ivlen, \
2657 gctx->ivlen = EVP_CIPHER_get_iv_length(c->cipher); in aes_gcm_ctrl()
2665 *(int *)ptr = gctx->ivlen; in aes_gcm_ctrl()
2672 if ((arg > EVP_MAX_IV_LENGTH) && (arg > gctx->ivlen)) { in aes_gcm_ctrl()
2678 gctx->ivlen = arg; in aes_gcm_ctrl()
2698 memcpy(gctx->iv, ptr, gctx->ivlen); in aes_gcm_ctrl()
2706 if ((arg < 4) || (gctx->ivlen - arg) < 8) in aes_gcm_ctrl()
2710 if (c->encrypt && RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0) in aes_gcm_ctrl()
2718 CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen); in aes_gcm_ctrl()
2719 if (arg <= 0 || arg > gctx->ivlen) in aes_gcm_ctrl()
2720 arg = gctx->ivlen; in aes_gcm_ctrl()
2721 memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg); in aes_gcm_ctrl()
2726 ctr64_inc(gctx->iv + gctx->ivlen - 8); in aes_gcm_ctrl()
2733 memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg); in aes_gcm_ctrl()
2734 CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen); in aes_gcm_ctrl()
2775 if ((gctx_out->iv = OPENSSL_malloc(gctx->ivlen)) == NULL) in aes_gcm_ctrl()
2777 memcpy(gctx_out->iv, gctx->iv, gctx->ivlen); in aes_gcm_ctrl()
2853 CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); in aes_gcm_init_key()
2860 CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); in aes_gcm_init_key()
2862 memcpy(gctx->iv, iv, gctx->ivlen); in aes_gcm_init_key()
3021 int sz = gctx->ivlen - offset; in aes_gcm_iv_generate()
3024 if (sz <= 0 || gctx->ivlen < 12) in aes_gcm_iv_generate()
3056 CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen); in aes_gcm_cipher()
3857 octx->ivlen = EVP_CIPHER_get_iv_length(c->cipher); in aes_ocb_ctrl()
3865 *(int *)ptr = octx->ivlen; in aes_ocb_ctrl()
3873 octx->ivlen = arg; in aes_ocb_ctrl()
3975 if (CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen) in aes_ocb_init_key()
3984 CRYPTO_ocb128_setiv(&octx->ocb, iv, octx->ivlen, octx->taglen); in aes_ocb_init_key()
3986 memcpy(octx->iv, iv, octx->ivlen); in aes_ocb_init_key()