Skip to content

Commit

Permalink
keychain: fix signature byte insertion test
Browse files Browse the repository at this point in the history
ECDSA is not failing if byte insertion occurs at the end.
  • Loading branch information
yoursunny committed Sep 29, 2019
1 parent 5a6f5cc commit aee2cf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/keychain/test-fixture/sign-verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ export async function execute(cls: PacketCtor, pvtA: PrivateKey, pubA: PublicKey
pktMi.sigValue = (() => {
const sig = new Uint8Array(pktMi.sigValue!.byteLength + 1);
sig.set(pktMi.sigValue!, 0);
const offset = Math.floor(Math.random() * sig.byteLength);
const offset = 1 + Math.floor(Math.random() * sig.byteLength - 2);
sig.copyWithin(offset + 1, offset);
sig[offset] = Math.random() * 0x100;
sig[offset] = 0xBB;
return sig;
})();

Expand Down

0 comments on commit aee2cf8

Please sign in to comment.