HydroKDF

This module contains functions for key derivation.

Example:

(def context (Hydro.context "Examples"))

(let-do [master-key (HydroKDF.keygen)]
  (println* &(HydroKDF.derive-from-key 32 1 context &master-key))
  (println* &(HydroKDF.derive-from-key 32 2 context &master-key))
  (println* &(HydroKDF.derive-from-key 64 3 context &master-key))))

derive-from-key

defn

(Fn [Int, Int, (Ptr CChar), (Ref (Array Byte) a)] (Maybe (Array Byte)))

                    (derive-from-key subkey-len id ctx key)
                

derives a subkey of length subkey-len with the ID id, using the context ctx and the master key key.

keygen

defn

(Fn [] (Array Byte))

                    (keygen)
                

generates a master key for use in key derivation procedures.