src: hide kMaxDigestMultiplier outside HKDF impl#46206
src: hide kMaxDigestMultiplier outside HKDF impl#46206nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
|
Review requested:
|
This comment was marked as outdated.
This comment was marked as outdated.
bnoordhuis
left a comment
There was a problem hiding this comment.
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.
Nit: It might be better suited to make this a static, but just as suggestion.
There was a problem hiding this comment.
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 <info@bnoordhuis.nl> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
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 <info@bnoordhuis.nl> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
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 <info@bnoordhuis.nl> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
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 <info@bnoordhuis.nl> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
There is no reason to expose this constant outside of the HKDF implementation, especially with such a generic name.