Skip to content

Commit 4bb70c7

Browse files
committed
bitcoinjs#1522 some comments
1 parent 52a01b3 commit 4bb70c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ts_src/ecpair.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ function liftX(buffer: Buffer): Buffer | null {
133133
typeforce(types.Buffer256bit, buffer);
134134
const x = new BN(buffer);
135135
if (x.gte(EC_P)) return null;
136-
const xRed = x.toRed(EC_P_REDUCTION);
137-
const ySq = xRed
136+
const x1 = x.toRed(EC_P_REDUCTION);
137+
const ySq = x1
138138
.redPow(BN_3)
139139
.add(BN_7)
140140
.mod(EC_P);
@@ -145,8 +145,9 @@ function liftX(buffer: Buffer): Buffer | null {
145145
return null;
146146
}
147147
const y1 = (y & 1) === 0 ? y : EC_P.sub(y);
148+
// TODO: which is the best format to return the coordinates?
148149
return Buffer.concat([
149-
Buffer.from(x.toBuffer('be')),
150+
Buffer.from(x1.toBuffer('be')),
150151
Buffer.from(y1.toBuffer('be')),
151152
]);
152153
}

0 commit comments

Comments
 (0)