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