Lines Matching refs:iv
52 unsigned char *iv; /* Temporary IV store */ member
71 const unsigned char iv[16]);
108 unsigned char *iv; /* Temporary IV store */ member
145 const unsigned char *iv, int enc) in aesni_init_key() argument
185 ctx->iv, EVP_CIPHER_CTX_is_encrypting(ctx)); in aesni_cbc_cipher()
225 const unsigned char *iv, int enc) in aesni_gcm_init_key() argument
229 if (iv == NULL && key == NULL) in aesni_gcm_init_key()
245 if (iv == NULL && gctx->iv_set) in aesni_gcm_init_key()
246 iv = gctx->iv; in aesni_gcm_init_key()
247 if (iv) { in aesni_gcm_init_key()
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()
269 const unsigned char *iv, int enc) in aesni_xts_init_key() argument
273 if (iv == NULL && key == NULL) in aesni_xts_init_key()
315 if (iv) { in aesni_xts_init_key()
317 memcpy(ctx->iv, iv, 16); in aesni_xts_init_key()
328 const unsigned char *iv, int enc) in aesni_ccm_init_key() argument
332 if (iv == NULL && key == NULL) in aesni_ccm_init_key()
349 if (iv) { in aesni_ccm_init_key()
350 memcpy(ctx->iv, iv, 15 - cctx->L); in aesni_ccm_init_key()
362 const unsigned char *iv, int enc) in aesni_ocb_init_key() argument
366 if (iv == NULL && key == NULL) in aesni_ocb_init_key()
397 if (iv == NULL && octx->iv_set) in aesni_ocb_init_key()
398 iv = octx->iv; in aesni_ocb_init_key()
399 if (iv) { in aesni_ocb_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()
474 const unsigned char *iv, int enc) in aes_t4_init_key() argument
577 const unsigned char *iv, int enc) in aes_t4_gcm_init_key() argument
581 if (iv == NULL && key == NULL) in aes_t4_gcm_init_key()
609 if (iv == NULL && gctx->iv_set) in aes_t4_gcm_init_key()
610 iv = gctx->iv; in aes_t4_gcm_init_key()
611 if (iv) { in aes_t4_gcm_init_key()
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()
633 const unsigned char *iv, int enc) in aes_t4_xts_init_key() argument
637 if (!iv && !key) in aes_t4_xts_init_key()
698 if (iv) { in aes_t4_xts_init_key()
700 memcpy(ctx->iv, iv, 16); in aes_t4_xts_init_key()
711 const unsigned char *iv, int enc) in aes_t4_ccm_init_key() argument
715 if (iv == NULL && key == NULL) in aes_t4_ccm_init_key()
731 if (iv) { in aes_t4_ccm_init_key()
732 memcpy(ctx->iv, iv, 15 - cctx->L); in aes_t4_ccm_init_key()
744 const unsigned char *iv, int enc) in aes_t4_ocb_init_key() argument
748 if (iv == NULL && key == NULL) in aes_t4_ocb_init_key()
778 if (iv == NULL && octx->iv_set) in aes_t4_ocb_init_key()
779 iv = octx->iv; in aes_t4_ocb_init_key()
780 if (iv) { in aes_t4_ocb_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()
937 unsigned char *iv; member
1009 const unsigned char *iv, int enc);
1021 const unsigned char *iv, int enc) in s390x_aes_ecb_init_key() argument
1052 const unsigned char *iv = ctx->oiv; in s390x_aes_ofb_init_key() local
1064 memcpy(cctx->kmo.param.cv, iv, ivlen); in s390x_aes_ofb_init_key()
1075 unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(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()
1118 const unsigned char *iv = ctx->oiv; in s390x_aes_cfb_init_key() local
1135 memcpy(cctx->kmf.param.cv, iv, ivlen); in s390x_aes_cfb_init_key()
1147 unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(ctx); in s390x_aes_cfb_cipher() local
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()
1203 const unsigned char *iv = ctx->oiv; in s390x_aes_cfb8_init_key() local
1220 memcpy(cctx->kmf.param.cv, iv, ivlen); in s390x_aes_cfb8_init_key()
1230 unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(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()
1402 const unsigned char *iv) in s390x_aes_gcm_setiv() argument
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()
1450 gctx->iv = c->iv; in s390x_aes_gcm_ctrl()
1469 if (gctx->iv != c->iv) in s390x_aes_gcm_ctrl()
1470 OPENSSL_free(gctx->iv); in s390x_aes_gcm_ctrl()
1472 if ((gctx->iv = OPENSSL_malloc(len)) == NULL) in s390x_aes_gcm_ctrl()
1476 memset(gctx->iv + arg, 0, len - arg - 8); in s390x_aes_gcm_ctrl()
1477 *((unsigned long long *)(gctx->iv + len - 8)) = arg << 3; in s390x_aes_gcm_ctrl()
1503 memcpy(gctx->iv, ptr, gctx->ivlen); in s390x_aes_gcm_ctrl()
1515 memcpy(gctx->iv, ptr, arg); in s390x_aes_gcm_ctrl()
1518 if (enc && RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0) in s390x_aes_gcm_ctrl()
1528 s390x_aes_gcm_setiv(gctx, gctx->iv); 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()
1548 s390x_aes_gcm_setiv(gctx, gctx->iv); in s390x_aes_gcm_ctrl()
1584 if (gctx->iv == c->iv) { in s390x_aes_gcm_ctrl()
1585 gctx_out->iv = out->iv; in s390x_aes_gcm_ctrl()
1589 if ((gctx_out->iv = OPENSSL_malloc(len)) == NULL) in s390x_aes_gcm_ctrl()
1592 memcpy(gctx_out->iv, gctx->iv, len); in s390x_aes_gcm_ctrl()
1606 const unsigned char *iv, int enc) in s390x_aes_gcm_init_key() argument
1611 if (iv == NULL && key == NULL) in s390x_aes_gcm_init_key()
1627 if (iv == NULL && gctx->iv_set) in s390x_aes_gcm_init_key()
1628 iv = gctx->iv; in s390x_aes_gcm_init_key()
1630 if (iv != NULL) { in s390x_aes_gcm_init_key()
1631 s390x_aes_gcm_setiv(gctx, iv); in s390x_aes_gcm_init_key()
1637 s390x_aes_gcm_setiv(gctx, iv); in s390x_aes_gcm_init_key()
1639 memcpy(gctx->iv, iv, gctx->ivlen); in s390x_aes_gcm_init_key()
1767 if (gctx->iv != c->iv) in s390x_aes_gcm_cleanup()
1768 OPENSSL_free(gctx->iv); in s390x_aes_gcm_cleanup()
1779 const unsigned char *iv, int enc);
1966 unsigned char *ivec = ctx->iv; in s390x_aes_ccm_tls_cipher()
2017 const unsigned char *iv, int enc) in s390x_aes_ccm_init_key() argument
2022 if (iv == NULL && key == NULL) in s390x_aes_ccm_init_key()
2045 if (iv != NULL) { in s390x_aes_ccm_init_key()
2046 memcpy(ctx->iv, iv, 15 - cctx->aes.ccm.l); in s390x_aes_ccm_init_key()
2088 s390x_aes_ccm_setiv(cctx, ctx->iv, len); in s390x_aes_ccm_cipher()
2113 s390x_aes_ccm_setiv(cctx, ctx->iv, len); in s390x_aes_ccm_cipher()
2206 memcpy(c->iv, ptr, arg); in s390x_aes_ccm_ctrl()
2266 const unsigned char *iv, int enc);
2404 const unsigned char *iv, int enc) in aes_init_key() argument
2509 (*dat->stream.cbc) (in, out, len, &dat->ks, ctx->iv, in aes_cbc_cipher()
2512 CRYPTO_cbc128_encrypt(in, out, len, &dat->ks, ctx->iv, in aes_cbc_cipher()
2516 ctx->iv, dat->block); in aes_cbc_cipher()
2544 ctx->iv, &num, dat->block); in aes_ofb_cipher()
2556 ctx->iv, &num, in aes_cfb_cipher()
2569 ctx->iv, &num, in aes_cfb8_cipher()
2583 ctx->iv, &num, in aes_cfb1_cipher()
2592 ctx->iv, &num, in aes_cfb1_cipher()
2602 ctx->iv, &num, in aes_cfb1_cipher()
2623 ctx->iv, in aes_ctr_cipher()
2628 ctx->iv, in aes_ctr_cipher()
2645 if (gctx->iv != c->iv) in aes_gcm_cleanup()
2646 OPENSSL_free(gctx->iv); in aes_gcm_cleanup()
2658 gctx->iv = c->iv; in aes_gcm_ctrl()
2673 if (gctx->iv != c->iv) in aes_gcm_ctrl()
2674 OPENSSL_free(gctx->iv); in aes_gcm_ctrl()
2675 if ((gctx->iv = OPENSSL_malloc(arg)) == NULL) in aes_gcm_ctrl()
2698 memcpy(gctx->iv, ptr, gctx->ivlen); in aes_gcm_ctrl()
2709 memcpy(gctx->iv, ptr, arg); 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()
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()
2772 if (gctx->iv == c->iv) in aes_gcm_ctrl()
2773 gctx_out->iv = out->iv; 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()
2789 const unsigned char *iv, int enc) in aes_gcm_init_key() argument
2793 if (iv == NULL && key == NULL) in aes_gcm_init_key()
2850 if (iv == NULL && gctx->iv_set) in aes_gcm_init_key()
2851 iv = gctx->iv; in aes_gcm_init_key()
2852 if (iv) { in aes_gcm_init_key()
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()
3028 if (RAND_bytes(gctx->iv + offset, sz) <= 0) in aes_gcm_iv_generate()
3056 CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen); in aes_gcm_cipher()
3219 const unsigned char *iv, int enc) in aes_xts_init_key() argument
3223 if (iv == NULL && key == NULL) in aes_xts_init_key()
3327 if (iv) { in aes_xts_init_key()
3329 memcpy(ctx->iv, iv, 16); in aes_xts_init_key()
3361 ctx->iv); in aes_xts_cipher()
3362 else if (CRYPTO_xts128_encrypt(&xctx->xts, ctx->iv, in, out, len, in aes_xts_cipher()
3426 memcpy(c->iv, ptr, arg); in aes_ccm_ctrl()
3479 const unsigned char *iv, int enc) in aes_ccm_init_key() argument
3483 if (iv == NULL && key == NULL) in aes_ccm_init_key()
3522 if (iv != NULL) { in aes_ccm_init_key()
3523 memcpy(ctx->iv, iv, 15 - cctx->L); in aes_ccm_init_key()
3542 memcpy(ctx->iv + EVP_CCM_TLS_FIXED_IV_LEN, in, in aes_ccm_tls_cipher()
3546 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, in aes_ccm_tls_cipher()
3599 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, in aes_ccm_cipher()
3618 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len)) in aes_ccm_cipher()
3665 unsigned char *iv; member
3669 const unsigned char *iv, int enc) in aes_wrap_init_key() argument
3674 if (iv == NULL && key == NULL) in aes_wrap_init_key()
3687 if (iv == NULL) in aes_wrap_init_key()
3688 wctx->iv = NULL; in aes_wrap_init_key()
3690 if (iv != NULL) { in aes_wrap_init_key()
3693 memcpy(ctx->iv, iv, len); in aes_wrap_init_key()
3694 wctx->iv = ctx->iv; in aes_wrap_init_key()
3740 rv = CRYPTO_128_wrap_pad(&wctx->ks.ks, wctx->iv, in aes_wrap_cipher()
3744 rv = CRYPTO_128_unwrap_pad(&wctx->ks.ks, wctx->iv, in aes_wrap_cipher()
3749 rv = CRYPTO_128_wrap(&wctx->ks.ks, wctx->iv, in aes_wrap_cipher()
3752 rv = CRYPTO_128_unwrap(&wctx->ks.ks, wctx->iv, in aes_wrap_cipher()
3858 octx->iv = c->iv; in aes_ocb_ctrl()
3911 const unsigned char *iv, int enc) in aes_ocb_init_key() argument
3915 if (iv == NULL && key == NULL) in aes_ocb_init_key()
3972 if (iv == NULL && octx->iv_set) in aes_ocb_init_key()
3973 iv = octx->iv; in aes_ocb_init_key()
3974 if (iv) { in aes_ocb_init_key()
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()