You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle zero-length subkeys and improve HKDF robustness
Updated `DeriveSubkey` to return an empty byte array for zero-length subkey requests, ensuring compatibility with existing tests. Replaced `ThrowIfNegativeOrZero` with separate checks for zero and negative values.
Modified `HkdfExpand` to include a `lengthTag` parameter, representing the requested length as a 4-byte span. Updated the HMAC computation to mix `lengthTag` into the derivation process, ensuring subkeys with different `lengthBytes` values are distinct.
Improved comments to reflect these changes and enhanced the overall robustness and compatibility of the HKDF implementation.
0 commit comments