flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
12
BACK_BACK/node_modules/public-encrypt/withPublic.js
generated
vendored
Executable file
12
BACK_BACK/node_modules/public-encrypt/withPublic.js
generated
vendored
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
var BN = require('bn.js')
|
||||
var Buffer = require('safe-buffer').Buffer
|
||||
|
||||
function withPublic (paddedMsg, key) {
|
||||
return Buffer.from(paddedMsg
|
||||
.toRed(BN.mont(key.modulus))
|
||||
.redPow(new BN(key.publicExponent))
|
||||
.fromRed()
|
||||
.toArray())
|
||||
}
|
||||
|
||||
module.exports = withPublic
|
||||
Loading…
Add table
Add a link
Reference in a new issue