Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/ic_vetkeys/src/utils/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ test("protocol flow with precomputed data", () => {

assertEqual(
bytesToHex(ibe.serialize()),
"4943204942450001a9937528bda5826cf5c7da77a5f5e46719a9748f4ea0aa491c8fba92081e5d55457ab36ec4f6335954c6d87987d0b28301bd8da166493bb537c842d20396da5a68cc9e9672fadedf1e311e0057fc906dfd37d1077ca027954c45336405e66e5e4b346b0f24bfd358a09de701654c1e0791741e4826396588440eee021df9b2398f143c",
"4943204942450001a9937528bda5826cf5c7da77a5f5e46719a9748f4ea0aa491c8fba92081e5d55457ab36ec4f6335954c6d87987d0b28301bd8da166493bb537c842d20396da5a68cc9e9672fadedf1e311e0057fc906dfd37d1077ca027954c45336405e66e5e4b346b0f24bfd358a09de701654c1e0791741e4826396588440eee021df9b2399f7f98",
);

const ibeRec = IdentityBasedEncryptionCiphertext.deserialize(
Expand Down
10 changes: 9 additions & 1 deletion frontend/ic_vetkeys/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,16 @@ function maskSeed(seed: Uint8Array, t: Uint8Array): Uint8Array {
}

function maskMsg(msg: Uint8Array, seed: Uint8Array): Uint8Array {
/*
Zero prefix the length up to 20 digits, which is sufficient to be fixed
length for any 64-bit length. This ensures all of the MaskMsg domain
separators are of equal length. With how we use the domain separators, this
padding isn't required - we only need uniquness - but having variable
length domain separators is generally not considered a good practice and is
easily avoidable here.
*/
const domain_sep = IbeDomainSeparators.MaskMsg.concat(
msg.length.toString(),
msg.length.toString().padStart(20, "0"),
);
const xof_seed = deriveSymmetricKey(seed, domain_sep, 32);

Expand Down