mirage / mirage-crypto

Cryptographic primitives for OCaml, in OCaml (also used in MirageOS)
ISC License
77 stars 43 forks source link

mirage-crypto: revise DES to avoid global state in key derivation / key usage #223

Closed hannesm closed 6 months ago

hannesm commented 6 months ago

TODO: we should first get a DES unit test here -- with some hardcoded values for decrypt & encrypt. (done in 770001f73a5818735253deca77f499d998eb577f)

part of #220

hannesm commented 6 months ago

CI looks fine -- any review would be welcome. I don't see any speed difference on my laptop.

palainp commented 6 months ago

Hi @hannesm , my vCPU has proven to be slow and it gives unreliable performance results. So as CI is mostly green (I wonder why FreeBSD complains about random.generate, this has been merged upstream no?) and you don't observe slowness with more key copies, let's remove the globals and this PR LGTM :)

hannesm commented 6 months ago

The FreeBSD CI also checks the unikernel -- which uses Mirage_random.S with an upper bound of < 4.0.0 (the mirage utility embeds that) -- and Mirage_random.S interface in that version still generates Cstruct.t --> there's need for a mirage release that allows mirage-random 4.0.0 being used before this will be green again.