Skip to content

Sync with cryptolib upstream for week ending 2025-10-31#179

Draft
pqcfox wants to merge 9 commits intomasterfrom
kat/2025-10-31-upstream-cryptolib-sync
Draft

Sync with cryptolib upstream for week ending 2025-10-31#179
pqcfox wants to merge 9 commits intomasterfrom
kat/2025-10-31-upstream-cryptolib-sync

Conversation

@pqcfox
Copy link
Contributor

@pqcfox pqcfox commented Dec 23, 2025

This is a companion PR to #108 for merging in upstream cryptolib commits.

siemen11 and others added 9 commits December 22, 2025 18:09
The fpga_cw340_rom_ext targets include an RMA lifecycle test target for the CW340 FPGA which allows for GDB testing.

Signed-off-by: siemen11 <sdhooghe@google.com>
This commit adds AES-GCM to the cryptotest framework. The test vectors
are the nist_cavp_aes_gcm with 128, 192, 256 encrypt and decrypt.

As the cryptolib only supports tag sizes of 4,8,12,16 and iv sizes of
12, 16 bytes, other test vectors are filtered. Also, for performance
reasons, only AAD, CTX, PTX sizes of 64 bytes and less are tested.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
Check if we executed the expected case. This is a FI mitigation.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
Use hardened_check_*() to protect securit-critical if conditions
against faults.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
Check if the loop counter matches the expectation. This is a FI
countermeasure.

Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org>
This commit extends the Know-Answer-Test for the CSRNG with a NIST test
vector that contains additional_data for the generate command.

Signed-off-by: Florian Glaser <glaserf@lowrisc.org>
RSA-OAEP and RSA-PSS work on byte-reversed secret and non-secret
data. A reversal involves a series of memory accesses that can be
hardened by randomizing the access pattern (similarly to
`hardened_memcpy)`.

Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org>
Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org>
This commit changes the expected values for the tests that have an
expected result of 0. This makes sure we don't run into issues
where the tests are not executing properly and we still get a
correct result due to the expected value of 0.

Furthermore, this commit moves the tests to the hjson framework.

The input and output values don't change from before this change.
This commit merely skips the unnecessary calculations.

Signed-off-by: Hakim Filali <hfilali@lowrisc.org>
@pqcfox pqcfox changed the title Sync with cryptolib upstream for week ending 2025-10-24 Sync with cryptolib upstream for week ending 2025-10-31 Dec 23, 2025
@github-actions
Copy link

Welcome! Before accepting your contribution, the expo project requires you to sign the Contributor License Agreement. To indicate your agreement, please post a comment on this Pull Request with the message below.

If you are contributing on behalf of a company, please inform your supervisor to contact zeroRISC to sign a Corporate CLA instead.


I certify that I have read and agree that my contributions will be bound by the expo CLA.


0 out of 5 committers have signed the CLA.
@siemen11
@nasahlpa
@glaserf
@andrea-caforio
@h-filali
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@pqcfox
Copy link
Contributor Author

pqcfox commented Dec 23, 2025

Needs additional work, and waiting on merge of previous syncs; do not merge.

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.

6 participants