[Cryptech Tech] Status tamper detection and MKM erasure

Linus Nordberg linus at nordberg.se
Tue Jul 12 12:22:45 UTC 2016


Fredrik Thulin <fredrik at thulin.net> wrote
Mon, 11 Jul 2016 15:24:40 +0200:

> On fredag 10 juni 2016 kl. 16:21:52 CEST Linus Nordberg wrote:
> ...
>> I just pushed some code to user/ln5/tamper. From commit message:
>
> Thanks for writing this code. I've tested it thoroughly now, and gotten it to 
> work with a couple of changes:

Thanks for testing and fixing it!


> 0) Had to change -mmcu to attiny828 in the Makefile to get the code to run on 
> the ATtiny.

Hmm. According to GCC documentation [1], there's no such thing as
`-mmcu=attiny828'. AFAICT, `-mmcu=avr25 -D__AVR_ATtiny828__' should select
the correct instruction set and include the right header file(s).

--8<---------------cut here---------------start------------->8---
/usr/lib/avr/include/avr/io.h:
#elif defined (__AVR_ATtiny828__)
#  include <avr/iotn828.h>
--8<---------------cut here---------------end--------------->8---

[1] https://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html

What happens (or doesn't happen) when you compile with -mmcu=avr25?


> 1) Sleep mode seemed not to work - it seemed like the AVR was reset on wakeup 
> so if I released the panic button while it was flashing it's LED in the start 
> of main() the MKM would not get erased. We need to debug that, but I think 
> we'll need to go with busy-waiting for the moment (since it is just a couple 
> of days before Berlin). Maybe you and I can read the datasheet together in 
> Berlin.

Sounds like a plan. And yes, busy-waiting will do for now -- we don't
even have a battery to wear out. :)


> 2) The chip needed CS_N to go high to mark the end of the sequential read mode 
> select command.

Oh. Right.


> 3) Initialization should release control of the MKM to the FPGA.

That seems wise, even if the data sheets, IIRC, state that the system
starts up with the FPGA in control of the MKM.


> My work-in progress patch is attached. How do you want to incorporate it? 
> Should I just commit and push to your user/ln5/tamper repository?

I think that you should push to a topic branch in user/ft/tamper.

Thanks!


More information about the Tech mailing list