Initial implementation of SSHKDF for wolfprovider#382
Open
ColtonWilley wants to merge 2 commits intowolfSSL:masterfrom
Open
Initial implementation of SSHKDF for wolfprovider#382ColtonWilley wants to merge 2 commits intowolfSSL:masterfrom
ColtonWilley wants to merge 2 commits intowolfSSL:masterfrom
Conversation
padelsbach
reviewed
Apr 5, 2026
| /* Test input shared secret K. */ | ||
| unsigned char inKey[] = { | ||
| 0x00, 0x00, 0x00, 0x80, | ||
| 0x55, 0xba, 0xe9, 0x31, 0xc0, 0x7f, 0xd8, 0x24, |
Contributor
There was a problem hiding this comment.
Can we add a test case with the MSB set to test the sign extension path?
| * its own mpint encoding internally, so strip the caller's encoding | ||
| * to avoid double-encoding. */ | ||
| if (rawKeySz >= 4) { | ||
| word32 mpintLen = ((word32)rawKey[0] << 24) | |
Contributor
There was a problem hiding this comment.
wp_kbkdf.c uses this approach for endianness swap. Consider matching it here:
/* We are not guaranteed to have these available from wolfssl, so implement
* them here */
static void wp_c32toa(word32 wc_u32, byte* c) {
#ifdef WOLFSSL_USE_ALIGN
c[0] = (byte)((wc_u32 >> 24) & 0xff);
c[1] = (byte)((wc_u32 >> 16) & 0xff);
c[2] = (byte)((wc_u32 >> 8) & 0xff);
c[3] = (byte) (wc_u32 & 0xff);
#elif defined(LITTLE_ENDIAN_ORDER)
*(word32*)c = ByteReverseWord32(wc_u32);
#else
*(word32*)c = wc_u32;
#endif
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial implementation of SSHKDF for wolfprovider