rustpq / pqcrypto

Rust Post-Quantum cryptography
226 stars 41 forks source link

Made pqcrypto no-std compatible #25

Closed rozbb closed 3 years ago

rozbb commented 3 years ago

The pqcrypto crates are essentially already no-std, but they never specified it. Enabling this feature allows them to be used on embedded systems which perhaps don't have std support. The only real end-user change is that pqcrypto_traits::VerificationError will not impl std::error::Error when the std flag isn't set. I didn't include any of the generated files in the PR because that'd be wayyy too much to look at. You can regen yourself and hopefully see that everything is in order.

Last note: the new feature flag is std and it's included by default in every crate. I also noticed that the avx2 flag was never actually checked anywhere, so I took the liberty of including it where appropriate. Since the code within always uses std::is_x86_feature_detected, I made the avx2 feature always require std.

thomwiggers commented 3 years ago

Looks decent. I will put it on my pile of things; as I'm just returning from vacation this will take a little longer to get completed.