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

Size-optimised build #25

Open
baentsch opened this issue Jun 29, 2020 · 0 comments
Open

Size-optimised build #25

baentsch opened this issue Jun 29, 2020 · 0 comments

Comments

@baentsch
Copy link
Contributor

The current code+build structure generates some (object) code duplication as the same code gets compiled multiple times with different defines for different name spaces. This is not ideal for size-constrained environments (smart cards, HSMs) that have to provide all parameter options within one library. This also might be an issue for high-load servers having to serve clients with different parameter sets.

Just looking at the size of different .so libraries generated by make shared it seems there might be potential for saving ~54kB per algorithm combination in ref and ~60kB in avx2 (x64, -O3 compiled).

Looking at one library (build by cmake) containing all combinations (ref+avx2, dil2+3+4, plain+90s), the size differs (again, x64, -O3) between 714416 bytes and 347112 bytes supporting only the "dilithium3" parameter set (still including ref+avx2 & plain+90s), i.e., more than 50%.
This difference of course would change by doing even more code sharing (see also #21 ) and completely factoring out non-Dilithium core code (e.g., Keccak).

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

No branches or pull requests

1 participant