Skip to content

Commit 18b05fa

Browse files
committed
Formatting
1 parent 958aae3 commit 18b05fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ const verify = (sig, msgh, pub, opts = optV) => {
489489
abytes(sig, L2);
490490
abytes(msgh);
491491
abytes(pub); // Validate options, throw
492-
try { // Actual verification code begins here
492+
try {
493493
const sigg = Signature.fromBytes(sig); // throw error when DER is suspected now.
494494
const h = bits2int_modN(msgh); // Truncate hash
495495
const P = Point.fromBytes(pub); // Validate public key
@@ -560,7 +560,7 @@ const etc2 = {
560560
randomBytes: randomBytes,
561561
};
562562
const randomPrivateKey = () => {
563-
const num = M(bytesToNum(randomBytes(L + L / 2)), N - _1); // takes n+16 bytes
563+
const num = M(bytesToNum(randomBytes(L + L / 2)), N - _1); // takes 48 bytes
564564
return numTo32b(num + _1); // returns (hash mod n-1)+1
565565
};
566566
/** Curve-specific utilities for private keys. */

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ const invert = (num: bigint, md: bigint): bigint => { // modular inversion
236236
return b === _1 ? M(x, md) : err('no inverse'); // b is gcd at this point
237237
};
238238
const toPrivScalar = (pr: Bytes): bigint => { // normalize private key to bigint
239-
let num = bytesToNum(abytes(pr, L)); // convert to bigint when bytes
239+
let num = bytesToNum(abytes(pr, L)); // convert to bigint when bytes
240240
return arange(num, _1, N, 'private key invalid 3'); // check if bigint is in range
241241
};
242242
const highS = (n: bigint): boolean => n > (N >> _1); // if a number is bigger than CURVE.n/2

0 commit comments

Comments
 (0)