-
Notifications
You must be signed in to change notification settings - Fork 6
Description
dictionary HmacKeyGenParams : Algorithm {
required HashAlgorithmIdentifier hash;
[EnforceRange] unsigned long length;
};
The hash member represents the inner hash function to use.
The length member represent the length (in bits) of the key to generate. If unspecified, the recommended length will be used, which is the size of the associated hash function's block size.
In Node's initial implementation I've used the rate (R) SHA-3's sponge construction to inform the default HMAC length.
That is
SHA3-256: Rate (R) = 1088 bits
SHA3-384: Rate (R) = 832 bits
SHA3-512: Rate (R) = 576 bits
But it seems counter-intuitive that the larger the SHA is the shorter the key would be.
The alternative would be to use the Capacity (C) which is 1600-R
SHA3-256: Capacity (C) = 512 bits
SHA3-384: Capacity (C) = 768 bits
SHA3-512: Capacity (C) = 1024 bits
Can we clarify which is right to use as the default HmacKeyGenParams when SHA-3 hash is used?