Skip to content

crpytocb: support SHA224 under WOLF_CRYPTO_CB_ONLY_SHA256#10500

Open
rizlik wants to merge 1 commit into
wolfSSL:masterfrom
rizlik:sha224_only
Open

crpytocb: support SHA224 under WOLF_CRYPTO_CB_ONLY_SHA256#10500
rizlik wants to merge 1 commit into
wolfSSL:masterfrom
rizlik:sha224_only

Conversation

@rizlik
Copy link
Copy Markdown
Contributor

@rizlik rizlik commented May 19, 2026

No description provided.

@rizlik rizlik self-assigned this May 19, 2026
Copilot AI review requested due to automatic review settings May 19, 2026 08:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread wolfcrypt/src/sha256.c
Comment on lines +2397 to +2437
#ifdef WOLF_CRYPTO_CB_ONLY_SHA256

int wc_Sha224Update(wc_Sha224* sha224, const byte* data, word32 len)
{
if (sha224 == NULL)
return BAD_FUNC_ARG;
if (data == NULL && len == 0)
return 0;
if (data == NULL)
return BAD_FUNC_ARG;

#ifndef WOLF_CRYPTO_CB_FIND
if (sha224->devId != INVALID_DEVID)
#endif
{
int ret = wc_CryptoCb_Sha224Hash(sha224, data, len, NULL);
if (ret != WC_NO_ERR_TRACE(CRYPTOCB_UNAVAILABLE))
return ret;
}

return NO_VALID_DEVID;
}

int wc_Sha224Final(wc_Sha224* sha224, byte* hash)
{
int ret;

if (sha224 == NULL || hash == NULL)
return BAD_FUNC_ARG;

#ifndef WOLF_CRYPTO_CB_FIND
if (sha224->devId != INVALID_DEVID)
#endif
{
ret = wc_CryptoCb_Sha224Hash(sha224, NULL, 0, hash);
if (ret != WC_NO_ERR_TRACE(CRYPTOCB_UNAVAILABLE))
return ret;
}

return NO_VALID_DEVID;
}
Comment thread wolfcrypt/test/test.c
Comment on lines +72309 to +72319
/* set devId to invalid, so software is used */
info->hash.sha224->devId = INVALID_DEVID;
#if defined(WOLF_CRYPTO_CB_ONLY_SHA256)
#ifdef DEBUG_WOLFSSL
printf("CryptoDevCb: exampleVar %d\n", myCtx->exampleVar);
#endif
if (myCtx->exampleVar == 99) {
info->hash.sha224->devId = devIdArg;
return 0;
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants