This commit is contained in:
Paul Miller 2023-04-02 14:50:54 +00:00
parent d424c661fb
commit ed3ba3de6e
No known key found for this signature in database
GPG Key ID: 697079DA6878B89B

@ -571,21 +571,21 @@ describe('ed448', () => {
const message = Uint8Array.from([0xab, 0xbc, 0xcd, 0xde]); const message = Uint8Array.from([0xab, 0xbc, 0xcd, 0xde]);
const publicKey = ed448.getPublicKey(privateKey); const publicKey = ed448.getPublicKey(privateKey);
const signature = ed448.sign(message, privateKey); const signature = ed448.sign(message, privateKey);
const R = signature.slice(0, 56); const R = signature.slice(0, 56);
let s = signature.slice(56, 112); let s = signature.slice(56, 112);
s = bytesToHex(s.slice().reverse()); s = bytesToHex(s.slice().reverse());
s = BigInt('0x' + s); s = BigInt('0x' + s);
s = s + ed448.CURVE.n; s = s + ed448.CURVE.n;
s = numberToBytesLE(s, 56); s = numberToBytesLE(s, 56);
const sig_invalid = concatBytes(R, s); const sig_invalid = concatBytes(R, s);
return { sig_invalid, message, publicKey }; return { sig_invalid, message, publicKey };
} }
let sig; let sig;
while (true) { while (true) {
try { try {
sig = get56bSig(); sig = get56bSig();
break; break;
} catch (error) { } catch (error) {