2
$\begingroup$

I want to use the wiki UMAC example to protect the integrity of the communication between 2 devices. Unfortunately I am not quite sure of the meaning of the parameters and I don't want to get it wrong:

The following C function generates a 24 bit UMAC. It assumes that secret is a multiple of 24 bits, msg is not longer than secret and result already contains the 24 secret bits e.g. f(nonce). nonce does not need to be contained in msg.

void UHash24 (uchar *msg, uchar *secret, int len, uchar *result)
  • msg - my message
  • secret I assume it is the secret Key (present on both devices) 16 byte key which I'll duplicate as many times as necessary to make it bigger than the msg length.
  • len - the msg length
  • result - here I don't understand what f(nonce) mean - I have a 4 byte nonce - I assume that I should make a function to convert it to 3 byte?

I have seen in another post that secret should be f(nonce, Key) - is this a good suggestion? (f could be Tea algorithm)

Can I use the same f function, get only 3 bytes and use it for the result parameter?

$\endgroup$
  • $\begingroup$ Programming questions are off-topic here. But nonetheless you can edit your question into an attempt at learning the basics of message authentication codes. $\endgroup$ – DannyNiu Jan 25 at 6:17
  • $\begingroup$ I think the configuration parameters of a function are allowed here, even if they are - in the end - required for a C function. Now if there were issues applying the parameters or encoding the values then it becomes more of a programming question and it would be more at home at Stackoverflow. $\endgroup$ – Maarten Bodewes Jan 25 at 7:08
  • $\begingroup$ @DannyNiu I am interested in the logic/concepts of the algorithm itself; after having these I can use the function correctly. $\endgroup$ – John Rastem Jan 25 at 8:23
  • $\begingroup$ @John Rastem When it comes to the topic of UMAC, it is amazing how unclear the explanations tend to be. I too hope that someone will respond to this important question that lacks a clear answer elsewhere on the internet. $\endgroup$ – Patriot Jul 6 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.