ascon / ascon-c

Ascon - Lightweight Authenticated Encryption & Hashing
https://ascon.iaik.tugraz.at/
Creative Commons Zero v1.0 Universal
189 stars 30 forks source link

Message in bytes #10

Closed Ruppity closed 1 year ago

Ruppity commented 1 year ago

Hello, I was trying to add a print statement for the message, and I added a print statement in the getcycles file, so I would like to ask how does the random message and the sorted cycles work, when I print out the message it remains the same for each of the cycles per byte, how does that work, is it not supposed to be increasing? or does it add the random numbers before printing the cycles per byte or after it, or does it use a certain range of the numbers used?

Thank you for your time

mschlaeffer commented 1 year ago

The message is always initialized in the init_input function with length MAX_LEN. init_input is called by the measure function. So you need to print after calling init_input, before cpucycles_start and using message length mlen (passed to the measure function). It does not matter that the allocated, initialized message is actually larger. What matters is the mlen passed to crypto_aead_encrypt since that's actually measured.

Ruppity commented 1 year ago

Ok thank you very much!