Lines Matching refs:ivlen

40     ctx->ivlen = (EVP_GCM_TLS_FIXED_IV_LEN + EVP_GCM_TLS_EXPLICIT_IV_LEN);  in ossl_gcm_initctx()
50 const unsigned char *iv, size_t ivlen, in gcm_init() argument
61 if (ivlen == 0 || ivlen > sizeof(ctx->iv)) { in gcm_init()
65 ctx->ivlen = ivlen; in gcm_init()
66 memcpy(ctx->iv, iv, ivlen); in gcm_init()
83 const unsigned char *iv, size_t ivlen, in ossl_gcm_einit() argument
86 return gcm_init(vctx, key, keylen, iv, ivlen, params, 1); in ossl_gcm_einit()
90 const unsigned char *iv, size_t ivlen, in ossl_gcm_dinit() argument
93 return gcm_init(vctx, key, keylen, iv, ivlen, params, 0); in ossl_gcm_dinit()
116 || !ctx->hw->setiv(ctx, ctx->iv, ctx->ivlen)) in getivgen()
118 if (olen == 0 || olen > ctx->ivlen) in getivgen()
119 olen = ctx->ivlen; in getivgen()
120 memcpy(out, ctx->iv + ctx->ivlen - olen, olen); in getivgen()
125 ctr64_inc(ctx->iv + ctx->ivlen - 8); in getivgen()
137 memcpy(ctx->iv + ctx->ivlen - inl, in, inl); in setivinv()
138 if (!ctx->hw->setiv(ctx, ctx->iv, ctx->ivlen)) in setivinv()
158 if (!OSSL_PARAM_set_size_t(p, ctx->ivlen)) { in ossl_gcm_get_ctx_params()
186 if (ctx->ivlen > p->data_size) { in ossl_gcm_get_ctx_params()
190 if (!OSSL_PARAM_set_octet_string(p, ctx->iv, ctx->ivlen) in ossl_gcm_get_ctx_params()
191 && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, ctx->ivlen)) { in ossl_gcm_get_ctx_params()
200 if (ctx->ivlen > p->data_size) { in ossl_gcm_get_ctx_params()
204 if (!OSSL_PARAM_set_octet_string(p, ctx->iv, ctx->ivlen) in ossl_gcm_get_ctx_params()
205 && !OSSL_PARAM_set_octet_ptr(p, &ctx->iv, ctx->ivlen)) { in ossl_gcm_get_ctx_params()
286 if (ctx->ivlen != sz) { in ossl_gcm_set_ctx_params()
290 ctx->ivlen = sz; in ossl_gcm_set_ctx_params()
400 int sz = ctx->ivlen - offset; in gcm_iv_generate()
403 if (sz <= 0 || ctx->ivlen < GCM_IV_DEFAULT_SIZE) in gcm_iv_generate()
440 if (!hw->setiv(ctx, ctx->iv, ctx->ivlen)) in gcm_cipher_internal()
508 memcpy(ctx->iv, iv, ctx->ivlen); in gcm_tls_iv_set_fixed()
515 || (ctx->ivlen - (int)len) < EVP_GCM_TLS_EXPLICIT_IV_LEN) in gcm_tls_iv_set_fixed()
520 if (RAND_bytes_ex(ctx->libctx, ctx->iv + len, ctx->ivlen - len, 0) <= 0) in gcm_tls_iv_set_fixed()