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

core/crypto: More improvements #4124

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

Yawning
Copy link
Contributor

@Yawning Yawning commented Aug 23, 2024

  • Cleanups/improvements
    • Refactor the blake2 code to use SIMD?
    • (AMD64) Support hardware accelerated SHA-224/SHA-256.
    • Switch to using context-less panic
    • Improve/add benchmarks
  • More algorithms?
    • Add X448
    • AEGIS
    • Deoxys-II
    • Argon2
    • ChaCha8Rng

@Yawning Yawning force-pushed the feature/crypto branch 9 times, most recently from 8450ddd to 26fb0a1 Compare August 30, 2024 19:26
@Yawning Yawning force-pushed the feature/crypto branch 6 times, most recently from b6f512d to 363df33 Compare September 5, 2024 20:26
@Yawning Yawning force-pushed the feature/crypto branch 3 times, most recently from 4198575 to f69bb60 Compare September 15, 2024 22:43
@Yawning Yawning force-pushed the feature/crypto branch 7 times, most recently from 7d37012 to 00e013b Compare September 26, 2024 07:17
@Yawning Yawning force-pushed the feature/crypto branch 4 times, most recently from 6f62ca6 to e8dc9bc Compare October 13, 2024 17:32
@Yawning Yawning force-pushed the feature/crypto branch 4 times, most recently from 6c91c67 to 78d9d75 Compare October 21, 2024 17:40
@Yawning Yawning force-pushed the feature/crypto branch 5 times, most recently from cadf7c9 to d77b40d Compare November 2, 2024 03:29
st.rate = _RATE_128L

for _ in 0 ..< 10 {
update_hw_128l(st, iv, key)

Choose a reason for hiding this comment

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

For a bit of performance improvement: since the input is constant, and we don't need to compute a key stream here, the state can be kept in bitsliced form during the initialization rounds. Same for finalization.
In bitsliced form, the rotation of the AES blocks is just a one-bit shift of the bytes.

During AD absorption, you can also keep the state in bitsliced form, and only bitslice the input blocks.

Also for the sbox, there are faster circuits than the Boyar-Peralta: https://eprint.iacr.org/2019/802.pdf

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