Skip to content

Conversation

jeffro256
Copy link
Contributor

Calling oaes_alloc, then oaes_key_import_data, then oaes_free calls the functions calloc and free four times each. This PR rewrites the key expansion function to expand directly into a 240 byte buffer with no allocations. This should speed up Cryptonight on platforms such as Raspberry PI. Hash tests are expanded to test slow hash using software AES on all platforms.

Depends on #9505

@SyntheticBird45 reported that the OpenBSD compiler gives warnings about string functions used in `oaes_sprintf`,
as well as use of `rand()` in `oaes_key_gen`. Neither of these functions are used in the codebase. Removing the
unused OAES functions silences these warnings.
Calling `oaes_alloc`, then `oaes_key_import_data`, then `oaes_free` calls the functions `calloc` and `free` four times each. This PR rewrites the key expansion function to expand directly into a 240 byte buffer with no allocations. This should speed up Cryptonight on platforms such as Raspberry PI. Hash tests are expanded to test slow hash using software AES on all platforms.

Depends on monero-project#9505
@0xFFFC0000
Copy link
Collaborator

I have a question. Our OpenAES that we are using right is canonical OpenAES implementation? or we do have custom code change there?

@jeffro256
Copy link
Contributor Author

I'm pretty sure it's canonical, but we just don't use most of it.

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

Successfully merging this pull request may close these issues.

3 participants