Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3f42f96

Browse filesBrowse files
tniessenaduh95
authored andcommitted
crypto: strengthen argument CHECKs in TurboSHAKE
Instead of first discarding the top 24 bits of the argument and then checking that the low 8 bits are within the expected range, first check that the original 32-bit integer is within the expected range and then discard the top 24 bits. PR-URL: #62763 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 7efc2ce commit 3f42f96
Copy full SHA for 3f42f96

1 file changed

+4-4Lines changed: 4 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/crypto/crypto_turboshake.cc‎

Copy file name to clipboardExpand all lines: src/crypto/crypto_turboshake.cc
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,10 @@ Maybe<void> TurboShakeTraits::AdditionalConfig(
449449

450450
// args[offset + 1] = domain separation byte (uint32)
451451
CHECK(args[offset + 1]->IsUint32());
452-
params->domain_separation =
453-
static_cast<uint8_t>(args[offset + 1].As<Uint32>()->Value());
454-
CHECK_GE(params->domain_separation, 0x01);
455-
CHECK_LE(params->domain_separation, 0x7F);
452+
uint32_t domain_separation_u32 = args[offset + 1].As<Uint32>()->Value();
453+
CHECK_GE(domain_separation_u32, 0x01);
454+
CHECK_LE(domain_separation_u32, 0x7F);
455+
params->domain_separation = static_cast<uint8_t>(domain_separation_u32);
456456

457457
// args[offset + 2] = output length in bytes (uint32)
458458
CHECK(args[offset + 2]->IsUint32());

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.