proxmark3 icon indicating copy to clipboard operation
proxmark3 copied to clipboard

Rework crypto in fw: mbedtls / standalone AES / bearssl ?

Open doegox opened this issue 6 years ago • 8 comments
trafficstars

doegox avatar Apr 19 '19 12:04 doegox

@iceman1001 Any reason why mbedtls is in common/ ? I though common/ is for common stuff between bootrom & armsrc while mbedtls is used only in client.

doegox avatar Jun 06 '19 10:06 doegox

Ask piwi? he did a lot of these shuffle around.
I totally agree common is suppose to be code that is shared with client/device. However I think the mbedtls is also possible to compile and make use add support for cryptos on deviceside and that would be the cause to its relocation to common.

It would be nice to have 3des / aes / des on deviceside for DesFire implementation etc.

iceman1001 avatar Jun 06 '19 12:06 iceman1001

Today:

  • common: code used only in armsrc & bootrom and not client (I think)
  • common/mbedtls: code used only in client

For AES/DES in pm3, mbedtls would be very much overkill, we can drop just small AES/DES implems for pm3

doegox avatar Jun 06 '19 12:06 doegox

the thing is we had small des/aes implements but they where dropped in order to use mbedtls. Luckily you don't have to compile the whole mbedtls just for AES or single crypton, you can compile those that is needed with few extras. So I see no need to drop this to go back to custom crypto implementations on deviceside.

iceman1001 avatar Jun 06 '19 13:06 iceman1001

ok we'll see when the first one will make the effort of compiling mbedtls in armsrc... BTW this will very probably require two different common/mbedtls/config.h for client & pm3

doegox avatar Jun 06 '19 13:06 doegox

There's still a duplicated aes.c file right now. I would believe to migrate everything to mbedtls or bearssl would be a benefit in the future. Since mbedtls is already in, we could try to remove the other aes.c file. Especially since it takes ~5KB just for AES tables.

slurdge avatar Jul 10 '19 16:07 slurdge

well, no problem removing stuff but make sure that there is no standalone, or other code using it... then make sure mbedtls is working...

iceman1001 avatar Jul 10 '19 19:07 iceman1001

hey... arent' we using mbedtls now on arm and client?!?

iceman1001 avatar Jun 25 '20 21:06 iceman1001