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

ASCON: repeated transient memory allocation #3

Open
lzaoral opened this issue Nov 29, 2022 · 1 comment
Open

ASCON: repeated transient memory allocation #3

lzaoral opened this issue Nov 29, 2022 · 1 comment

Comments

@lzaoral
Copy link
Contributor

lzaoral commented Nov 29, 2022

Both AsconCore#encrypt and AsconCore#decrypt allocate a fresh piece of transient memory per every call:

https://github.com/MiragePV/OptimizedJCAlgs/blob/056abc90c8bd98b93495470a6077d962087db873/AEAD/ASCON/src/AsconCore.java#L156-L157
https://github.com/MiragePV/OptimizedJCAlgs/blob/056abc90c8bd98b93495470a6077d962087db873/AEAD/ASCON/src/AsconCore.java#L251-L252

This fact makes the implementation practically unusable with cards having no or unreliable garbage collection. Note that the allocations depend on the size of the user provided method argument (cipher/plaintext and associated data) so it is not as trivial to solve as in the case of #2.

Detected-by: JCProfilerNext

@petrs
Copy link
Member

petrs commented Sep 26, 2024

We have the ASCON code now fixed and will update it soon via PR.

UPDATE: the new ASCON code (to be merged at some point) is here: https://github.com/crocs-muni/jc-ascon

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

2 participants