iqlusioninc / usbarmory.rs

Bare metal Rust support for USB armory MkII devices
Apache License 2.0
58 stars 4 forks source link

Multi-channel AES encryption #49

Open tarcieri opened 4 years ago

tarcieri commented 4 years ago

This is a note about how we intend to use AES encryption, and the need for multi-channel support.

We're using AES-GCM-SIV, with the goal of performing AES on the DCP/CAAM, and accelerating the GHASH-like universal hash function (POLYVAL) using NEON instructions on the M7.

Notably AES-GCM-SIV uses 2 AES keys: it's keyed with a single AES key (I'd like to use the UNIQUE key for this), but uses AES as a KDF / CTR-DRBG in order to derive a per-nonce child key:

https://github.com/RustCrypto/AEADs/blob/master/aes-gcm-siv/src/lib.rs#L259

To make that work, we'll need multiple AES channels. In practice I think it will look something like:

japaric commented 4 years ago

related PR: #50