conorpp / u2f-zero

U2F USB token optimized for physical security, affordability, and style
Other
2.42k stars 203 forks source link

[Question] Porting u2f-zero to Digispark #28

Closed Akasurde closed 8 years ago

Akasurde commented 8 years ago

This is rather a question than a issue. Can we port this port this code to DigiSpark ? It would be nice.

ccoenen commented 8 years ago

This circuit uses a cryptographic coprocessor which is not on the digispark. At the very least this would have to be added. I'm not sure the ATtiny85 on the Digispark could even talk to it. It does not have I2C, so you'd have to jump through some hoops to get this set up first.

I'm not directly involved in this project, so a more detailed answer would have to come from the actual author.

conorpp commented 8 years ago

The code was written so it could be ported easily.

It does use an I2C peripheral to handle ECC and SHA256 operations. So you would have to fill in the API calls like u2f_ecdsa_sign, u2f_new_keypair, u2f_sha256_start, etc. with your own implementation.

The final U2F Zero firmware is about 15 KB which is already more than the 8 KB of the ATtiny. Adding software implementations of ECC operations and SHA256 would be impossible. Even if you could, it would be very slow -- on the scale of 1-10 seconds per ECC operation.

Akasurde commented 8 years ago

@ccoenen @conorpp Thanks for info.