Skip to content

Commit

Permalink
fix getLeaf function
Browse files Browse the repository at this point in the history
  • Loading branch information
remicolin committed Jan 1, 2025
1 parent d8a22d3 commit 7ee31e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions common/src/utils/pubkeyTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export function getLeaf(dsc: string): string {
let qy = splitToWords(BigInt(hexToDecimal(y)), n, k);
return customHasher([sigAlgIndex, ...qx, ...qy]);
} else {
const { modulus, bits } = publicKeyDetails as PublicKeyDetailsRSA;
const sigAlgKey = `${signatureAlgorithm}_${hashAlgorithm}_${modulus}_${bits}`;
const { modulus, bits, exponent } = publicKeyDetails as PublicKeyDetailsRSA;
const sigAlgKey = `${signatureAlgorithm}_${hashAlgorithm}_${exponent}_${bits}`;
const { n, k } = getNAndK(sigAlgKey as SignatureAlgorithm);
const pubkeyChunked = splitToWords(BigInt(hexToDecimal(modulus)), n, k);

Expand All @@ -74,8 +74,8 @@ export function getLeafCSCA(dsc: string): string {
let qy = splitToWords(BigInt(hexToDecimal(y)), n, k);
return customHasher([sigAlgIndex, ...qx, ...qy]);
} else {
const { modulus, bits } = publicKeyDetails as PublicKeyDetailsRSA;
const sigAlgKey = `${signatureAlgorithm}_${hashAlgorithm}_${modulus}_${bits}`;
const { modulus, bits, exponent } = publicKeyDetails as PublicKeyDetailsRSA;
const sigAlgKey = `${signatureAlgorithm}_${hashAlgorithm}_${exponent}_${bits}`;
const sigAlgIndex = SignatureAlgorithmIndex[sigAlgKey];

if (sigAlgIndex == undefined) {
Expand Down

0 comments on commit 7ee31e0

Please sign in to comment.