Skip to content

Commit

Permalink
lib: fix BN v5/v4 interoperability issue (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 authored May 20, 2020
1 parent c69b4ae commit b31c2c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/bn.js
Original file line number Diff line number Diff line change
Expand Up @@ -2972,7 +2972,13 @@
} else if (cmp > 0) {
r.isub(this.p);
} else {
r.strip();
if (r.strip !== undefined) {
// r is BN v4 instance
r.strip();
} else {
// r is BN v5 instance
r._strip();
}
}

return r;
Expand Down

0 comments on commit b31c2c3

Please sign in to comment.