Skip to content

Commit

Permalink
Fix HMAC in arkgHmacKem
Browse files Browse the repository at this point in the history
  • Loading branch information
emlun committed Nov 14, 2024
1 parent a986844 commit ff01d1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/arkg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function arkgHmacKem<PublicKey, PrivateKey>(
false,
["sign"],
);
const t = toU8(await crypto.subtle.sign("HMAC", mk, info_sub)).slice(0, 16);
const t = toU8(await crypto.subtle.sign("HMAC", mk, c_prime)).slice(0, 16);

const k = await crypto.subtle.deriveBits(
{
Expand Down Expand Up @@ -214,7 +214,7 @@ function arkgHmacKem<PublicKey, PrivateKey>(
["sign"],
);

const t_prime = new Uint8Array(await crypto.subtle.sign("HMAC", mk, info_sub)).slice(0, 16);
const t_prime = new Uint8Array(await crypto.subtle.sign("HMAC", mk, c_prime)).slice(0, 16);
if (byteArrayEquals(t, t_prime)) {
const k = await crypto.subtle.deriveBits(
{
Expand Down

0 comments on commit ff01d1c

Please sign in to comment.