摘要:
如,计算17x+3120y=1 /** * 辗转相除法计算私钥d * @param {BigInt} e 公钥 * @param {BigInt} n 两个大素数之积,P*Q * @returns {BigInt} 余数, d, k */ function gcdEx(e, n) { if(!n){ 阅读全文
posted @ 2021-09-30 20:00
pangqianjin
阅读(165)
评论(0)
推荐(0)
摘要:
/** * 计算a**b(mod c) * @param {bigInt} a 底数 * @param {bigInt} b 指数 * @param {bigInt} c 模 * @returns {binInt}结果 */ function fastPowerMod(a, b, c){ let r 阅读全文
posted @ 2021-09-30 18:55
pangqianjin
阅读(75)
评论(0)
推荐(0)
摘要:
/** * 判断两个大整数是否互质 * @param {binInt} a 第一个整数 * @param {bigInt} b 第二个整数 * @returns {false} 最大公约数是否为1 */ function isCoprime(a, b){ let x = a let y = b le 阅读全文
posted @ 2021-09-30 18:24
pangqianjin
阅读(354)
评论(0)
推荐(0)
摘要:
/** * 计算a**b(mod c) * @param {bigInt} a 底数 * @param {bigInt} b 指数 * @param {bigInt} c 模 * @returns {binInt}结果 */ function fastPowerMod(a, b, c){ let r 阅读全文
posted @ 2021-09-30 18:23
pangqianjin
阅读(183)
评论(0)
推荐(0)

浙公网安备 33010602011771号