Current Folder
This commit is contained in:
1 parent
8b3382289b
commit
cfcada880d
4379 files changed
No files matched your search
+12
@@ -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
|
||||
Reference in new issue
Block a user