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

Optimize CRC24 using pclmulqdq #323

Open
dignifiedquire opened this issue Mar 24, 2024 · 0 comments
Open

Optimize CRC24 using pclmulqdq #323

dignifiedquire opened this issue Mar 24, 2024 · 0 comments

Comments

@dignifiedquire
Copy link
Member

There is a rust implementation for the non streaming version in https://github.com/TobiasBengtsson/crc24-openpgp-fast. It should be possible to implement a version that is streaming based on the paper and this code with the logic

  • init state
  • update when a chunk comes in
    • combine with existing stored state
    • if >= 2 * 4 * 128 bits, fold_by_4 reduction, store state, store rest
    • when it is less, just store the new rest
  • finish
    • do the regular reduction based on the current state, the stored rest and fold_by_1 and barret reduction

This would speed up both reading and writing armored data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant