chipsalliance / caliptra-sw

Caliptra software (ROM, FMC, runtime firmware), and libraries/tools needed to build and test
Apache License 2.0
53 stars 39 forks source link

hmac384 driver: inconsistent calls to zeroize #1537

Open korran opened 4 months ago

korran commented 4 months ago

The hmac384 driver has two modes of operation: single-shot (via Hmac384::hmac()) and incremental (via Hmac384::init() and Hmac384Op::finalize()).

Hmac384::hmac() calls zeroize after it is done with the peripheral:

https://github.com/chipsalliance/caliptra-sw/blob/60d38f94d618f26c837e588a042b9551330bcc83/drivers/src/hmac384.rs#L244-L254

Hmac384Op::finalize() does not:

https://github.com/chipsalliance/caliptra-sw/blob/60d38f94d618f26c837e588a042b9551330bcc83/drivers/src/hmac384.rs#L521-L527