forked from wolfSSL/wolfssl
Not cryptocb's job to sanity check input
Don't need to check parameters at every level
This commit is contained in:
@ -544,13 +544,11 @@ int wc_AriaDerive(ecc_key* private_key, ecc_key* public_key,
|
|||||||
ret = wc_AriaInitSha(&(info->hash.sha256->hSession), MC_ALGID_SHA256);
|
ret = wc_AriaInitSha(&(info->hash.sha256->hSession), MC_ALGID_SHA256);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((ret == 0) || (ret == CRYPTOCB_UNAVAILABLE))
|
if ((ret == 0) || (ret == CRYPTOCB_UNAVAILABLE)) {
|
||||||
&& (info->hash.in != NULL)) {
|
|
||||||
ret = wc_AriaShaUpdate(info->hash.sha256->hSession,
|
ret = wc_AriaShaUpdate(info->hash.sha256->hSession,
|
||||||
(byte *) info->hash.in, info->hash.inSz);
|
(byte *) info->hash.in, info->hash.inSz);
|
||||||
}
|
}
|
||||||
if (((ret == 0) || (ret == CRYPTOCB_UNAVAILABLE))
|
if ((ret == 0) || (ret == CRYPTOCB_UNAVAILABLE)) {
|
||||||
&& (info->hash.digest != NULL)) {
|
|
||||||
MC_UINT digestSz = 32;
|
MC_UINT digestSz = 32;
|
||||||
ret = wc_AriaShaFinal(info->hash.sha256->hSession,
|
ret = wc_AriaShaFinal(info->hash.sha256->hSession,
|
||||||
info->hash.digest, &digestSz);
|
info->hash.digest, &digestSz);
|
||||||
@ -573,13 +571,11 @@ int wc_AriaDerive(ecc_key* private_key, ecc_key* public_key,
|
|||||||
ret = wc_AriaInitSha(&(info->hash.sha384->hSession), MC_ALGID_SHA384);
|
ret = wc_AriaInitSha(&(info->hash.sha384->hSession), MC_ALGID_SHA384);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((ret == 0) || (ret == CRYPTOCB_UNAVAILABLE))
|
if ((ret == 0) || (ret == CRYPTOCB_UNAVAILABLE)) {
|
||||||
&& (info->hash.in != NULL)) {
|
|
||||||
ret = wc_AriaShaUpdate(info->hash.sha384->hSession,
|
ret = wc_AriaShaUpdate(info->hash.sha384->hSession,
|
||||||
(byte *) info->hash.in, info->hash.inSz);
|
(byte *) info->hash.in, info->hash.inSz);
|
||||||
}
|
}
|
||||||
if (((ret == 0) || (ret == CRYPTOCB_UNAVAILABLE))
|
if ((ret == 0) || (ret == CRYPTOCB_UNAVAILABLE)) {
|
||||||
&& (info->hash.digest != NULL)) {
|
|
||||||
MC_UINT digestSz = 48;
|
MC_UINT digestSz = 48;
|
||||||
ret = wc_AriaShaFinal(info->hash.sha384->hSession,
|
ret = wc_AriaShaFinal(info->hash.sha384->hSession,
|
||||||
info->hash.digest, &digestSz);
|
info->hash.digest, &digestSz);
|
||||||
|
Reference in New Issue
Block a user