-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: hide kMaxDigestMultiplier outside HKDF impl #46206
src: hide kMaxDigestMultiplier outside HKDF impl #46206
Conversation
Review requested:
|
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but perhaps put it in HKDFTraits
or even HKDFTraits::AdditionalConfig()
?
(I also wonder whether it's correct. Length can't be > digest size * 255? Why? Not self-evident.)
It may remain not self-evident but it is as per RFC 5869 |
This comment was marked as outdated.
This comment was marked as outdated.
There is no reason to expose this constant outside of the HKDF implementation, especially with such a generic name.
229b1e1
to
364d675
Compare
Done, thank you.
I added an explaining comment. The limit arises from
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
// HKDF-Expand computes up to 255 HMAC blocks, each having as many bits as the | ||
// output of the hash function. 255 is a hard limit because HKDF appends an | ||
// 8-bit counter to each HMAC'd message, starting at 1. | ||
constexpr size_t kMaxDigestMultiplier = 255; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: It might be better suited to make this a static, but just as suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was static
before and I intentionally removed the keyword. Could you elaborate on why static
would be beneficial here?
My understanding is that since kMaxDigestMultiplier
is not ODR-used, not making it static
allows the compiler to completely eliminate any storage space for it, but I might be wrong about this.
Landed in bcc2d58 |
There is no reason to expose this constant outside of the HKDF implementation, especially with such a generic name. PR-URL: nodejs#46206 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
There is no reason to expose this constant outside of the HKDF implementation, especially with such a generic name. PR-URL: #46206 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
There is no reason to expose this constant outside of the HKDF implementation, especially with such a generic name. PR-URL: #46206 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
There is no reason to expose this constant outside of the HKDF implementation, especially with such a generic name. PR-URL: #46206 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
There is no reason to expose this constant outside of the HKDF implementation, especially with such a generic name.