Election-Tech-Initiative / electionguard-cpp

A C++ implementation of ElectionGuard specification focused on encryption components.
https://www.electionguard.vote/
MIT License
23 stars 26 forks source link

Add support for using the 32 bit optimized HACL code. #279

Closed jeffspel-crypto closed 2 years ago

jeffspel-crypto commented 2 years ago

Issue

Use the 32 bit optimized HACL code when building for _WIN32

Fixes #180

Description

The change is to use 32 bit optimized HACL functions when building for _WIN32. This will hopefully give us a performance speed up on the _WIN32 platform. The issue indicates that this change requires a different storage of big numbers in memory. I do not believe this to be true. Because big numbers are currently stored in memory as 64 bit numbers so memory is allocated on a 64 bit boundary. This means that the memory is definitely on a 32 bit boundary. We do have to cast uint64_t pointers to uine32_t pointers in order for the HACL code to work but the memory should not be an issue.

Testing

This is a low level code change that is covered by current tests.