You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.4 KiB

  1. function test() {
  2. let m = "1952805748";
  3. console.log("using: https://sci-hub.do/10.1109/ICCKE.2013.6682844");
  4. // R would be received from the Signer
  5. let signerRx = "59371873487402651110657306418818354906476102545298559461791300717696053835454";
  6. let signerRy = "98322875246066710654579302898391677189379767946198239290895789444110962324342";
  7. let blindRes = blind(m, signerRx, signerRy);
  8. console.log("blind", blindRes);
  9. // Q & sBlind would be received from the Signer
  10. let signerQx = "26613296432153871833441195158297038913673464785502568519907582377915678491093";
  11. let signerQy = "81940194042971427014176158889809922552127995083760111384335138546589994227275";
  12. let sBlind = "7240298625621589352655632414257224668430424461224914067754717095121139699933353374227084479180038954015287518505167995306229258561275087198611946596619855";
  13. let unblindRes = unblind(sBlind, m, blindRes.uA, blindRes.uB, blindRes.uFx, blindRes.uFy);
  14. console.log("unblind", unblindRes);
  15. // ---
  16. // v0
  17. console.log("using: http://www.isecure-journal.com/article_39171_47f9ec605dd3918c2793565ec21fcd7a.pdf");
  18. // Q & R would be received from the Signer
  19. blindRes = blindv0(m, signerQx, signerQy, signerRx, signerRy);
  20. console.log("blindv0", blindRes);
  21. // sBlind would be received from the Signer
  22. unblindRes = unblindv0(sBlind, m, blindRes.uB, blindRes.uC, blindRes.uFx, blindRes.uFy);
  23. console.log("unblindv0", unblindRes);
  24. }