UNPKG

@shard-auth/client

Version:

Next-generation API authentication without secret keys - MPC-based authentication with FROST threshold signatures

32 lines 1.11 kB
"use strict"; /** * 署名セッション管理 * 実際の協調署名では、参加者間でコミットメントを共有する必要がある */ Object.defineProperty(exports, "__esModule", { value: true }); exports.startSigningSession = startSigningSession; exports.addParticipant = addParticipant; exports.getCommitments = getCommitments; exports.getNonce = getNonce; const signature_1 = require("./frost/signature"); // グローバルな署名セッション(実際は通信で実現) let globalCommitments = new Map(); let globalNonces = new Map(); function startSigningSession() { globalCommitments.clear(); globalNonces.clear(); } function addParticipant(index) { const nonce = (0, signature_1.generateNonce)(); const commitment = (0, signature_1.computeNonceCommitment)(nonce); globalNonces.set(index, nonce); globalCommitments.set(index, commitment); return { nonce, commitment }; } function getCommitments() { return new Map(globalCommitments); } function getNonce(index) { return globalNonces.get(index); } //# sourceMappingURL=signing-session.js.map