Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHA2 Increment with arbitrary length (non-block sizes) #1614

Merged
merged 10 commits into from
Nov 27, 2023

Conversation

ashman-p
Copy link
Contributor

New internal API void OQS_SHA2_sha256_inc(OQS_SHA2_sha256_ctx *state, const uint8_t *in, size_t len)

Tested interactions and ordered combinations of OQS_SHA2_sha256_inc_blocks(), OQS_SHA2_sha256_inc() followed by OQS_SHA2_sha256_inc_finalize().

  • Does this PR change the input/output behaviour of a cryptographic algorithm (i.e., does it change known answer test values)? (If so, a version bump will be required from x.y.z to x.(y+1).0.)
  • Does this PR change the list of algorithms available -- either adding, removing, or renaming? Does this PR otherwise change an API? (If so, PRs in fully supported downstream projects dependent on these, i.e., oqs-provider and OQS-OpenSSH will also need to be ready for review and merge by the time this is merged.)

@ashman-p ashman-p requested a review from dstebila as a code owner November 17, 2023 22:11
@ashman-p ashman-p self-assigned this Nov 17, 2023
@ashman-p
Copy link
Contributor Author

Hi Gentlemen,
I went ahead and included the changes for LMS to use the new SHA2 increment API.
Look it over when you can. I will be back the Monday after thanksgiving.
Cheers,
Norm

src/common/sha2/sha2_c.c Outdated Show resolved Hide resolved
src/common/sha2/sha2_c.c Outdated Show resolved Hide resolved
Copy link
Member

@dstebila dstebila left a comment

Choose a reason for hiding this comment

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

Looks pretty good, other than using OQS_MEM_secure_free.

Copy link
Member

@SWilson4 SWilson4 left a comment

Choose a reason for hiding this comment

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

This looks great, thanks Norm. I think it's good to go pending a NULL check after malloc in inc_blocks and finalize.

src/common/sha2/sha2_armv8.c Show resolved Hide resolved
src/common/sha2/sha2_c.c Show resolved Hide resolved
src/common/sha2/sha2_c.c Show resolved Hide resolved
src/common/sha2/sha2_armv8.c Show resolved Hide resolved
src/common/sha2/sha2_c.c Outdated Show resolved Hide resolved
src/common/sha2/sha2_armv8.c Outdated Show resolved Hide resolved
src/common/sha2/sha2_c.c Outdated Show resolved Hide resolved
src/common/sha2/sha2_c.c Outdated Show resolved Hide resolved
src/common/sha2/sha2_c.c Outdated Show resolved Hide resolved
src/common/sha2/sha2_c.c Outdated Show resolved Hide resolved
@SWilson4 SWilson4 requested a review from dstebila November 27, 2023 19:20
@ashman-p ashman-p merged commit 1173278 into stateful-sigs Nov 27, 2023
22 checks passed
@ashman-p ashman-p deleted the na_sha2_increment branch November 27, 2023 22:26
SWilson4 pushed a commit that referenced this pull request Dec 15, 2023
* Enhanced with new SHA2 API that allows arbitary length updates

* Fix style

* Fix format

* Document struct members

* Fix comparison sign

* Use OQS SHA2 API

* Add nl at end

* Use OQS_MEM_secure_free instead of free

* Updated per review... mem check after malloc, use memcpy

* Fix style
SWilson4 pushed a commit that referenced this pull request Feb 14, 2024
* Enhanced with new SHA2 API that allows arbitary length updates

* Fix style

* Fix format

* Document struct members

* Fix comparison sign

* Use OQS SHA2 API

* Add nl at end

* Use OQS_MEM_secure_free instead of free

* Updated per review... mem check after malloc, use memcpy

* Fix style
cothan pushed a commit that referenced this pull request Apr 2, 2024
* Enhanced with new SHA2 API that allows arbitary length updates

* Fix style

* Fix format

* Document struct members

* Fix comparison sign

* Use OQS SHA2 API

* Add nl at end

* Use OQS_MEM_secure_free instead of free

* Updated per review... mem check after malloc, use memcpy

* Fix style
SWilson4 pushed a commit that referenced this pull request Apr 12, 2024
* Enhanced with new SHA2 API that allows arbitary length updates

* Fix style

* Fix format

* Document struct members

* Fix comparison sign

* Use OQS SHA2 API

* Add nl at end

* Use OQS_MEM_secure_free instead of free

* Updated per review... mem check after malloc, use memcpy

* Fix style
SWilson4 pushed a commit that referenced this pull request Apr 12, 2024
* Enhanced with new SHA2 API that allows arbitary length updates

* Fix style

* Fix format

* Document struct members

* Fix comparison sign

* Use OQS SHA2 API

* Add nl at end

* Use OQS_MEM_secure_free instead of free

* Updated per review... mem check after malloc, use memcpy

* Fix style
SWilson4 pushed a commit that referenced this pull request Apr 12, 2024
* Enhanced with new SHA2 API that allows arbitary length updates

* Fix style

* Fix format

* Document struct members

* Fix comparison sign

* Use OQS SHA2 API

* Add nl at end

* Use OQS_MEM_secure_free instead of free

* Updated per review... mem check after malloc, use memcpy

* Fix style
SWilson4 pushed a commit that referenced this pull request May 14, 2024
* Enhanced with new SHA2 API that allows arbitary length updates

* Fix style

* Fix format

* Document struct members

* Fix comparison sign

* Use OQS SHA2 API

* Add nl at end

* Use OQS_MEM_secure_free instead of free

* Updated per review... mem check after malloc, use memcpy

* Fix style
ashman-p added a commit that referenced this pull request Jun 4, 2024
commit e356ebf Na lms (#1486)
commit 55094c3 LMS H5_W1 (#1513)
commit 4d773d7 Convert to use OQS_SIG_STFL_SECRET_KEY struct  (#1525)
commit 245aede LMS updated to use new SK API (#1533)
commit a85a9aa Stateful sigs secret key storage callback (#1553)
commit 3934949 Na statful sig lock (#1559)
commit 3db6b44 Secret Key Query  (#1572)
commit 2446c64 Na stateful sigs lms var (#1574)
commit 8df2539 Stateful sigs XMSS updates (#1590)
commit a7b2987 SHA2 Increment with arbitrary length (non-block sizes) (#1614)
commit 2dd9e07 Na lms kat multi level (#1620)
commit 982b440 Fix Build Errors (#1635)
commit ddae644 Various fixes
commit cc50ef0 Fix warning
commit cf03392 Update README.md
commit 9325713 Update README.md
commit a52b217 Update README.md
commit d442ac9 Update README.md
commit 72ab478 Update README.md
commit 5967f12 Update src/CMakeLists.txt
commit fc6d512 Update documentation and license text. (#1663)
commit e7a83c7 Disable Stateful Signatures in the build by default (#1676)
commit 6c81bae Na stateful macro (#1687)

Signed-off-by: Norman Ashley <[email protected]>
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.

4 participants