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

SPHINCS+ SHAKE aarch64 implementation is never enabled #1967

Closed
SWilson4 opened this issue Oct 29, 2024 Discussed in #1965 · 4 comments · Fixed by #1972
Closed

SPHINCS+ SHAKE aarch64 implementation is never enabled #1967

SWilson4 opened this issue Oct 29, 2024 Discussed in #1965 · 4 comments · Fixed by #1972
Assignees
Labels
bug Something isn't working; high priority to fix

Comments

@SWilson4
Copy link
Member

Discussed in https://github.com/orgs/open-quantum-safe/discussions/1965

Originally posted by wadaphaq October 28, 2024
When testing the algorithms' performace with and without CPU extensions, I noticed that sphincs shake algorithms have same performance with or without the CPU extension enabled in the building process. Upon inspection of the liboqs I noticed that the cmakelists in the sphincs src folder do not include an aarch64 version, and even after building liboqs the aarch64 version is missing from the source folder. Is there a way to activate and build the aarch64 version of the sphincs shake algorithms?

@SWilson4 SWilson4 added the bug Something isn't working; high priority to fix label Oct 29, 2024
@SWilson4 SWilson4 self-assigned this Oct 29, 2024
@SWilson4
Copy link
Member Author

It looks to me like the aarch64 implementations of SPHINCS+ were added to the library in PR #1420, but they are present in an "ignore" list here:

ignore: pqclean_sphincs-shake-256s-simple_aarch64, pqclean_sphincs-shake-256s-simple_aarch64, pqclean_sphincs-shake-256f-simple_aarch64, pqclean_sphincs-shake-192s-simple_aarch64, pqclean_sphincs-shake-192f-simple_aarch64, pqclean_sphincs-shake-128s-simple_aarch64, pqclean_sphincs-shake-128f-simple_aarch64, pqclean_kyber512_aarch64, pqclean_kyber1024_aarch64, pqclean_kyber768_aarch64, pqclean_dilithium2_aarch64, pqclean_dilithium3_aarch64, pqclean_dilithium5_aarch64

This means that the aarch64 directories are not updated with the copy_from_upstream script. In fact, if you delete the aarch64 implementations and then rerun copy_from_upstream, the deleted directories are not replaced.

@dstebila @baentsch Do you happen to remember what the intent was with regard to these schemes in #1420? Did we want to exclude them from the library for some reason? (This was before my time.)

@dstebila
Copy link
Member

@dstebila @baentsch Do you happen to remember what the intent was with regard to these schemes in #1420? Did we want to exclude them from the library for some reason? (This was before my time.)

I don't recall for sure, but I think it was just that we only made the effort for the generic implementation at the time.

@baentsch
Copy link
Member

@dstebila @baentsch Do you happen to remember what the intent was with regard to these schemes in #1420? Did we want to exclude them from the library for some reason? (This was before my time.)

I don't recall for sure, but I think it was just that we only made the effort for the generic implementation at the time.

I don't recall either -- but do remember that Sphincs never was one of our "favourite" algorithms, so may very well have been treated along the lines of "just make it work", i.e., "skip optimizations if they cause headaches" -- particularly right before/potentially delaying a release.

@SWilson4
Copy link
Member Author

After looking into this, I don't think this will be as simple as simply "switching on" the aarch64 implementations—work would need to be done on FIPS 202 shims (for which we would need "x2" versions in addition to the exsting "x4 versions).

I suspect the aarch64 code was pulled in via a copy_from_upstream run on an earlier commit on the dev branch for #1420 before the aarch64 implementations were added to the ignore list. copy_from_upstream would never have deleted the code afterward, and it was presumably missed in code review due to the ridiculous number of files changed in the src/sig/sphincs directory. We don't advertise an aarch64 implementation for SPHINCS+ anywhere in our documentation.

I would be inclined to simply delete the aarch64 directories for now and deal with aarch64 implementations as part of #1894 (if we want to support ARM-optimized implementations of SLH-DSA). It would seem to be a waste of effort to have to redo the integration work to accommodate further upstream changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working; high priority to fix
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants