-
Notifications
You must be signed in to change notification settings - Fork 258
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
Support no_unroll
for Ascon
#567
Conversation
This helps when used on resource constrained systems, e.g. MCUs, to keep the binary size small.
Personally, I do not like such "transparent" features. You can easily enable it in your project by adding this line to your project's Cargo.toml: ascon = { version = "*", features = ["no_unroll"] } Note that we have similar feature in To summarize: I am inclined to close this PR and its AEAD counterpart. |
FWIW I'm okay with it. It seems like something we should make easy given Ascon primarily targets embedded devices |
Maybe we then should make manual unrolling gated by a feature or configuration flag and keep the unrolled version as the default? |
Sounds good to me (i.e. switching to an @sebastinas WDYT? |
I'd rather not. I have no data to check if the |
@sebastinas I'm testing |
Hi, I've tested the differences again and I'm quite sure we can close this. Without
Total use: 626 bytes for With
Total use: 554 bytes for This is the callsite for reference: #[inline(never)]
pub fn ascon_mac(id: &[u8; 12]) -> [u8; 6] {
use ascon_hash::{AsconXof, ExtendableOutput, Update, XofReader};
let mut xof = AsconXof::default();
xof.update(id);
let mut reader = xof.finalize_xof();
let mut dst = [0u8; 6];
reader.read(&mut dst);
dst
} |
Have you compiled it with |
@newpavlov This is built with:
As is very common in the embedded space we use indeed I think I found what got me hunting this to start with. I was benchmarking |
This helps when used on resource constrained systems, e.g. MCUs, to keep the binary size small.