mirror of https://github.com/openssl/openssl.git
gcm: use TRIE based param name decoder
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/27392)
This commit is contained in:
parent
bf0f1b5d6f
commit
0d969379cb
|
|
@ -146,11 +146,9 @@ int ossl_gcm_get_ctx_params(void *vctx, OSSL_PARAM params[])
|
|||
PROV_GCM_CTX *ctx = (PROV_GCM_CTX *)vctx;
|
||||
OSSL_PARAM *p;
|
||||
size_t sz;
|
||||
int type;
|
||||
|
||||
for (p = params; p->key != NULL; p++) {
|
||||
type = ossl_param_find_pidx(p->key);
|
||||
switch (type) {
|
||||
for (p = params; p->key != NULL; p++)
|
||||
switch (ossl_cipher_aead_get_ctx_params_find_pidx(p->key)) {
|
||||
default:
|
||||
break;
|
||||
|
||||
|
|
@ -238,7 +236,6 @@ int ossl_gcm_get_ctx_params(void *vctx, OSSL_PARAM params[])
|
|||
if (!OSSL_PARAM_set_uint(p, ctx->iv_gen_rand))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -248,14 +245,12 @@ int ossl_gcm_set_ctx_params(void *vctx, const OSSL_PARAM params[])
|
|||
const OSSL_PARAM *p;
|
||||
size_t sz;
|
||||
void *vp;
|
||||
int type;
|
||||
|
||||
if (ossl_param_is_empty(params))
|
||||
return 1;
|
||||
|
||||
for (p = params; p->key != NULL; p++) {
|
||||
type = ossl_param_find_pidx(p->key);
|
||||
switch (type) {
|
||||
for (p = params; p->key != NULL; p++)
|
||||
switch (ossl_cipher_aead_set_ctx_params_find_pidx(p->key)) {
|
||||
default:
|
||||
break;
|
||||
|
||||
|
|
@ -320,8 +315,6 @@ int ossl_gcm_set_ctx_params(void *vctx, const OSSL_PARAM params[])
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue