• HKDF is really two functions, HKDF-Extract and HKDF-Expand. If you already have a uniform random key then you can skip the first and just use the latter, removing the need for a salt.

      If you are using SHA-256 and are happy with 128-bit security then this boils down to:

      keymaterial = HMAC(key, b“some context” + byte(1))
      key1 = keymaterial[:16]
      key2 = keymaterial[16:]
      

      Where “some context” is eg a fixed string like “my-app-cascade-mac-subkeys” or whatever.


      score 1 · canonical