AnsweredAssumed Answered

C code for forcing variables into registers R0 and upwards

Question asked by h.a on Mar 7, 2012
Latest reply on Mar 7, 2012 by h.a

I would be grateful if someone could show me how, using C language or by using a line of assembler in a C program, I can force storage of a variable in a register r0 and upwards in an STM32. Even a very basic example will do. 

In particular, I would like to force the storage of a result from an encryption peripheral into such a register without intermediate storage elsewhere, if that is also possible.  

I want to increase my code security. I've been making a study of the security features and holes in the STM32. Even if you burn out USART and JTAG, there are SEM/FIB facilities available to rent for Euro 200 an hour that can cut into a depackaged die, kill off the CPU and hijack the memory counter circuit to act as a full memory scanner, and read out the hex. I've learned a lot by posing as a pirating client seek to hire these firms!  Therefore I have a couple of good scheme in mind that I think would offer additional protection if we could make use of the in-cpu registers and avoid SRAM for key any help would be most appreciated and could form the seed of higher piracy security for newbies as the discussion grows.

I deeply appreciate any expertise you might be able to offer,