How to use the red function from bn.js
Find comprehensive JavaScript bn.js.red code examples handpicked from public code repositorys.
GitHub: onlykey/onlykey.github.io
![onlykey profile picture](/onlykey.png?size=40)
57 58 59 60 61 62 63 64 65 66
function BaseCurve(type, conf) { this.type = type; this.p = new BN(conf.p, 16); // Use Montgomery, when there is no fast reduction for the prime this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); // Useful for many curves this.zero = new BN(0).toRed(this.red); this.one = new BN(1).toRed(this.red);
bn.js.prototype is the most popular function in bn.js (15750 examples)