factorizator.spec.js 521 B

1234567891011
  1. const Factorizator = require('../../gramjs/crypto/Factorizator')
  2. describe('calcKey function', () => {
  3. test('it should return 0x20a13b25e1726bfc', () => {
  4. const input = BigInt('325672672642762197972197217945794795197912791579174576454600704764276407047277')
  5. const { p, q } = Factorizator.factorize(input)
  6. const outP = BigInt(19)
  7. const outQ = BigInt('17140666981198010419589327260304989220942778504167082971294773934961916160383')
  8. expect([p, q]).toEqual([outP, outQ])
  9. })
  10. })