Skip to content

Commit

Permalink
src: fix incorrect comments in crypto
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node#44470
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
tniessen authored and guangwong committed Jan 3, 2023
1 parent 3d5b306 commit 216a4e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/crypto/crypto_cipher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ void CipherBase::InitIv(const char* cipher_type,

// Throw if an IV was passed which does not match the cipher's fixed IV length
// static_cast<int> for the iv_buf.size() is safe because we've verified
// prior that the value is not larger than MAX_INT.
// prior that the value is not larger than INT_MAX.
if (!is_authenticated_mode &&
has_iv &&
static_cast<int>(iv_buf.size()) != expected_iv_len) {
Expand Down
4 changes: 2 additions & 2 deletions src/crypto/crypto_keygen.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ struct KeyPairGenTraits final {
};

struct SecretKeyGenConfig final : public MemoryRetainer {
size_t length; // Expressed a a number of bits
char* out = nullptr; // Placeholder for the generated key bytes
size_t length; // In bytes.
char* out = nullptr; // Placeholder for the generated key bytes.

void MemoryInfo(MemoryTracker* tracker) const override;
SET_MEMORY_INFO_NAME(SecretKeyGenConfig)
Expand Down

0 comments on commit 216a4e8

Please sign in to comment.