nstilt1 / crypto-on-the-edge

A WIP Rust crate for generating private keys from IDs based on an HKDF, and eliminates the need to store private keys.
Apache License 2.0
0 stars 0 forks source link

Change initialization methods to only take data for initializing one HKDF #11

Open nstilt1 opened 4 months ago

nstilt1 commented 4 months ago

The initialization methods are a little too complex, requiring 1-2 byte slices and an initialized MAC and a mutable rng seed. This seems like it's a bit too much, given that we are working with an HKDF that is capable of generating the seeds/keys.

I believe it should be much simpler to just take 1 or 2 byte slices to initialize a master HKDF, which is then used to derive the internal HKDF, MAC, and RNG.

The only problem with this approach is that there would then be a single point of failure, but it should be okay since the binary and source code are still single points of failure regardless.