hashlet-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Hashlet-users] HMAC Feature


From: Josh Datko
Subject: [Hashlet-users] HMAC Feature
Date: Sun, 26 Jan 2014 17:38:45 -0700

Proposal for HMAC feature:

This is what I think will be the easiest:

I will add the CLI code to route a HMAC message to command.c  Once that infrastructure is in place, this will allow Kyle to start developing the HMAC interface to the device.

My general paradigm is to keep the command facing software in driver/command.c.  The command looks something like this: https://github.com/cryptotronix/hashlet/blob/master/src/driver/command.c#L480-L529

If I define the signature, it should allow you to jump start developing of the actual command.  How does that sound?

Some development pointers:

1. It's been only me so far, so if you have a question ask.  
2. If something sucks, please point it out.  I'll add an issue.  Again, there has been only a few eyeballs on this code!
3. The datasheet can be confusing, especially with bit order.  When the datasheet refers to bit fields the number is like this:

76543210

Sometimes, they will start describing bit 0 first, but bit 0 is the LSB always.

4. I'm passing struct octet_buffer s around by value on purpose.  They contain a pointer and a len.  There are functions in util.h to free and malloc the buffers, which will automatically zero out the data.

5. GNU coding styles.  If you are using Emacs, this should be easy.  If not, I can fix the formatting if your editor is sub-standard :P

5. When debugging, pass the -v option.  This will dump all the bytes on the wire and makes debugging a lot easier.  A logic analyzer is nice to have, but the bare metal I2c stuff seems to be working.

6. If you use GDB, keep mind that the device will go to sleep after a few milliseconds and some internal state will be cleared.  

7.  Use assert liberally, but not in the case of external data where a Denial-of-service could occur.


8. There is a basic test file: https://github.com/cryptotronix/hashlet/blob/master/src/tests/test_cli.sh

It should be run only after personalization.  I'd like to incorporate the NIST test keys, but have to figure out how to do that.

Thanks for the help!  I think the HMAC feature will be very cool.

Josh

reply via email to

[Prev in Thread] Current Thread [Next in Thread]