@ocap/mpc-hsm 0.0.0-stage → 1.33.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/bip39-english-wordlist.d.mts +11 -0
- package/esm/bip39-english-wordlist.mjs +31 -0
- package/esm/constants.d.mts +140 -0
- package/esm/constants.mjs +142 -0
- package/esm/dkg.d.mts +279 -0
- package/esm/dkg.mjs +903 -0
- package/esm/index.d.mts +17 -0
- package/esm/index.mjs +18 -0
- package/esm/mta.d.mts +63 -0
- package/esm/mta.mjs +275 -0
- package/esm/ocap-clear-signing.d.mts +125 -0
- package/esm/ocap-clear-signing.mjs +1170 -0
- package/esm/offline-ceremony.d.mts +127 -0
- package/esm/offline-ceremony.mjs +481 -0
- package/esm/ot.d.mts +193 -0
- package/esm/ot.mjs +726 -0
- package/esm/personal-vault.d.mts +1292 -0
- package/esm/personal-vault.mjs +3615 -0
- package/esm/personal.d.mts +10 -0
- package/esm/personal.mjs +11 -0
- package/esm/presign.d.mts +242 -0
- package/esm/presign.mjs +951 -0
- package/esm/rlp-eip1559.d.mts +75 -0
- package/esm/rlp-eip1559.mjs +293 -0
- package/esm/secp256k1-scalar.d.mts +141 -0
- package/esm/secp256k1-scalar.mjs +474 -0
- package/esm/sign.d.mts +113 -0
- package/esm/sign.mjs +225 -0
- package/esm/steel-mnemonic.d.mts +55 -0
- package/esm/steel-mnemonic.mjs +247 -0
- package/esm/tweak.d.mts +100 -0
- package/esm/tweak.mjs +168 -0
- package/esm/ves-backup.d.mts +296 -0
- package/esm/ves-backup.mjs +1025 -0
- package/esm/x402-agent-guard.d.mts +111 -0
- package/esm/x402-agent-guard.mjs +780 -0
- package/lib/bip39-english-wordlist.cjs +33 -0
- package/lib/bip39-english-wordlist.d.cts +11 -0
- package/lib/constants.cjs +264 -0
- package/lib/constants.d.cts +140 -0
- package/lib/dkg.cjs +910 -0
- package/lib/dkg.d.cts +279 -0
- package/lib/index.cjs +420 -0
- package/lib/index.d.cts +17 -0
- package/lib/mta.cjs +280 -0
- package/lib/mta.d.cts +63 -0
- package/lib/ocap-clear-signing.cjs +1176 -0
- package/lib/ocap-clear-signing.d.cts +125 -0
- package/lib/offline-ceremony.cjs +487 -0
- package/lib/offline-ceremony.d.cts +127 -0
- package/lib/ot.cjs +744 -0
- package/lib/ot.d.cts +193 -0
- package/lib/personal-vault.cjs +3725 -0
- package/lib/personal-vault.d.cts +1292 -0
- package/lib/personal.cjs +338 -0
- package/lib/personal.d.cts +10 -0
- package/lib/presign.cjs +954 -0
- package/lib/presign.d.cts +242 -0
- package/lib/rlp-eip1559.cjs +303 -0
- package/lib/rlp-eip1559.d.cts +75 -0
- package/lib/secp256k1-scalar.cjs +527 -0
- package/lib/secp256k1-scalar.d.cts +141 -0
- package/lib/sign.cjs +233 -0
- package/lib/sign.d.cts +113 -0
- package/lib/steel-mnemonic.cjs +253 -0
- package/lib/steel-mnemonic.d.cts +55 -0
- package/lib/tweak.cjs +178 -0
- package/lib/tweak.d.cts +100 -0
- package/lib/ves-backup.cjs +1053 -0
- package/lib/ves-backup.d.cts +296 -0
- package/lib/x402-agent-guard.cjs +788 -0
- package/lib/x402-agent-guard.d.cts +111 -0
- package/package.json +80 -4
- package/README.md +0 -3
package/esm/index.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BIP39_ENGLISH_WORDLIST, BIP39_ENGLISH_WORD_TO_INDEX, CANONICAL_BIP39_ENGLISH_SHA256_HEX } from "./bip39-english-wordlist.mjs";
|
|
2
|
+
import { BLIND_SLOT_RECORD_BYTES, BSGS_M, CLOUD_SYNC_SEALED_BLOB_BYTES, DEFAULT_COLD_GUARDIANS, DEFAULT_COLD_THRESHOLD, DEFAULT_ONLINE_PARTIES, DEFAULT_ONLINE_THRESHOLD, DST_BASEOT_KEY_V1, DST_BASEOT_S_POK_V1, DST_CANARY_CHALLENGE_V1, DST_CANARY_SHARD_POK_V1, DST_CHILD_TWEAK_V1, DST_COT_ROW_V1, DST_DKG_COM_V2, DST_DKG_CTX_V2, DST_DKG_ECHO_V2, DST_DKG_POK_V2, DST_DKG_SELFTEST_V2, DST_DKG_SHARE_AAD_V2, DST_DKG_STEP1_AUTH_V1, DST_DKG_TRANSCRIPT_V2, DST_DKG_X25519_HKDF_V2, DST_EMERGENCY_SWEEP_NONCE_V1, DST_KOS15_CHI_V1, DST_LHL_GADGET_V1, DST_MTA_ETA_V1, DST_OT_CTR_IV_V1, DST_PERSONAL_ANNOUNCE_TICKET_V1, DST_PERSONAL_BASEOT_CTX_V1, DST_PERSONAL_BLIND_OCAP_VELOCITY_TAG_V1, DST_PERSONAL_BLIND_SLOT_TAG_V1, DST_PERSONAL_BLIND_VAULT_TAG_V1, DST_PERSONAL_BLIND_VELOCITY_TAG_V1, DST_PERSONAL_BLOB_AAD_V1, DST_PERSONAL_BLOB_MAGIC, DST_PERSONAL_CHALLENGE_ANNOUNCE_V1, DST_PERSONAL_CHALLENGE_ENTITLEMENT_APPLY_V1, DST_PERSONAL_CHALLENGE_PAIR_RESPLIT_V1, DST_PERSONAL_CHALLENGE_PRESIGN_INIT_V1, DST_PERSONAL_CHALLENGE_RESEAL_KID_V1, DST_PERSONAL_CHALLENGE_REVOKE_SLOT_V1, DST_PERSONAL_CHALLENGE_SEAL_ENROLL_V1, DST_PERSONAL_CHALLENGE_SESSION_LOCK_V1, DST_PERSONAL_CHALLENGE_SESSION_OPEN_V1, DST_PERSONAL_CHALLENGE_SIGN_V1, DST_PERSONAL_CHALLENGE_VETO_V1, DST_PERSONAL_CLEAR_PREVIEW_V1, DST_PERSONAL_CLOUD_BLOB_V1, DST_PERSONAL_CLOUD_SYNC_V1, DST_PERSONAL_CLUSTER_HDKG_V1, DST_PERSONAL_COLD_MANIFEST_V1, DST_PERSONAL_DEVICE_AAD_V1, DST_PERSONAL_DEVICE_ENV_V1, DST_PERSONAL_ENTITLEMENT_TICKET_V1, DST_PERSONAL_FIREWALL_ATTESTATION_V1, DST_PERSONAL_GUARDIAN_QUORUM_V1, DST_PERSONAL_PAIR_POP_V1, DST_PERSONAL_PAIR_SHARE_AAD_V1, DST_PERSONAL_PAIR_SHARE_BOX_V1, DST_PERSONAL_POLICY_V1, DST_PERSONAL_PWD_CLIENT_HKDF_V1, DST_PERSONAL_PWD_HSM_HKDF_V1, DST_PERSONAL_ROLE_QUORUM_V1, DST_PERSONAL_SEAL_ENROLL_ACTOR_POK_V1, DST_PERSONAL_SEAL_KEY_V1, DST_PERSONAL_SEAL_SALT_V1, DST_PERSONAL_SIMULATED_DELTA_V1, DST_PERSONAL_TRANSPORT_AAD_V1, DST_PERSONAL_TRANSPORT_BOX_V1, DST_PRESIG_COM_V1, DST_PRESIG_ID_V1, DST_PRESIG_PI_LIN_K_V1, DST_PRESIG_PI_POK_Z_V1, DST_PRESIG_POK_B_V1, DST_PRESIG_POK_CK_V1, DST_PRESIG_POK_GAMMA_V1, DST_PRESIG_RERAND_V1, DST_PRESIG_ZETA_HKDF_V1, DST_PRESIG_ZETA_V1, DST_RULE_TWEAK_V1, DST_VES_BIT_OR_V1, DST_VES_CHUNK_LIN_V1, ESCAPE_DRILL_MAX_AGE_SECONDS, FORBIDDEN_ONLINE_ROLE_ESCAPE_CANARY, HSM_SEALED_BLOB_BYTES, MAX_ACTIVE_PRESIGN_SESSIONS, MAX_BLIND_RECORDS, MAX_MPC_CLUSTER_NODES, MAX_MPC_PEER_MESSAGE_BYTES, MAX_MPC_SIGN_REQUEST_BYTES, MAX_ON_DEMAND_SILENCE_SECONDS, MAX_PERSONAL_CALL_DEPTH, MAX_PERSONAL_FIREWALL_ATTESTATION_TTL_SECONDS, MAX_PERSONAL_HTTP_BODY_BYTES, MAX_PERSONAL_JSON_DEPTH, MAX_PERSONAL_JWT_TTL_SECONDS, MAX_PERSONAL_JWT_UNSIGNED_BYTES, MAX_PERSONAL_OCAP_CBOR_DEPTH, MAX_PERSONAL_OCAP_DELEGATE_TTL_SECONDS, MAX_PERSONAL_OCAP_TX_BYTES, MAX_PERSONAL_TX_DATA_BYTES, MAX_RECOVERY_PACKAGE_BYTES, MAX_RULE_DAG_NODES, MAX_RULE_YAML_BYTES, MAX_TRAVEL_SESSION_TTL_SECONDS, MPC_PROTOCOL_VERSION, MpcErrorCode, MpcProtocolError, MpcRootLifecycleState, OT_BASE_PARTIAL_BITS, OT_COLUMN_BYTES, OT_EXTENSION_ROWS, OT_GADGET_BITS, OT_KAPPA_BITS, OT_KAPPA_BYTES, OT_LHL_EXTRA_BITS, OT_SACRIFICE_BITS, PEDERSEN_H_COMPRESSED_HEX, PEDERSEN_H_DST, PEDERSEN_H_MESSAGE, PERSONAL_PRESIG_TTL_SECONDS, SECP256K1_HALF_N, SECP256K1_N, SECP256K1_P } from "./constants.mjs";
|
|
3
|
+
import { Fn, H_scalar, LinearPedersenDleqProof, PEDERSEN_H, PEDERSEN_H_COMP33, PedersenPokProof, RandomBytesFn, SECP256K1_G, SECP256K1_ZERO, SchnorrPokProof, Secp256k1Point, addModN, assertScalarInField, assertScalarNonZero, assertValidX25519PublicKey, bytes32ToScalarNonZero, bytes32ToScalarStrict, bytesToBigIntBE, bytesToHex, computeX25519SharedSecret, concatBytes, constantTimeEqual, createLinearPedersenDleqProof, createPedersenPok, createSchnorrPokInBase, decodePointCompressed, defaultRandomBytes, encodePointCompressed, enumerateCombinations, evaluateFeldmanCommitments, evaluatePolynomialModN, hashTranscriptSha256, hexToBytes, invModN, lagrangeCoefficientAtZero, lengthPrefixedEncode, modN, mulBaseG, mulModN, mulPoint, negModN, normalizeHexBytes, normalizeSortedSubset, pedersenCommit, sampleScalarNonZero, scalarToBytes32, secp256k1, sortedSubsetBytes, subModN, subsetsEqual, u16be, u32be, u64be, u8, utf8Bytes, verifyLinearPedersenDleqProof, verifyPedersenPok, verifySchnorrPokInBase, zeroizeBytes } from "./secp256k1-scalar.mjs";
|
|
4
|
+
import { AppendOnlyDkgEchoLock, ColdBackupDealerInput, ColdBackupPlugin, DkgCeremonyConfig, DkgEchoLock, DkgEncryptedShareEnvelope, DkgParticipantSession, DkgRosterEntry, DkgRound1CommitMessage, DkgRound2RevealPayload, DkgRound3EchoMessage, DkgSubsetSelfTestSignature, MpcNodeProvisionedKeyRecord, OcapConsensusAnchor, assertSafeCeremonyId, computeDkgContextHash32, computeDkgSubsetSelfTestDigest32, promoteNodeRecordAfterSelfTests, validateAndComputeDkgContext } from "./dkg.mjs";
|
|
5
|
+
import { DerivedChildKey, MpcChildDerivationSpec, MpcTweakMode, applyAdditiveTweak, assertAllowedOnlineRole, deriveRoleBoundChild, deriveRuleBoundChild, deriveUntweakedChild, ecrecoverEthAddress, parseStrictEthAddress, pointToEthAddress, toEip55ChecksumAddress } from "./tweak.mjs";
|
|
6
|
+
import { BaseOtReceiverState, BaseOtSenderPendingSession, BaseOtSenderState, BaseOtStep1Message, BaseOtStep2Message, OtExtReceiverPendingState, OtExtSenderPendingState, OtExtStep1Message, OtExtStep2Message, OtExtStep3Message, VerifiedCotReceiverRows, VerifiedCotSenderRows, aes256EncryptBlock, baseOtReceiverStep2, baseOtSenderStep1, baseOtSenderStep3, bytes16ToU128LE, eklundhTranspose128x1024, expandColumnPrgAes256Ctr, expandKos15ChiWeights, gf128Mul, otExtendReceiverStep1, otExtendReceiverStep3, otExtendSenderStep2, otExtendSenderStep4VerifyBeforePads, u128ToBytes16LE, wipeBaseOtReceiverState, wipeBaseOtSenderState, wipeVerifiedCotReceiverRows, wipeVerifiedCotSenderRows } from "./ot.mjs";
|
|
7
|
+
import { GadgetMtaPayload, decomposeScalarWithLhlGadget, deriveDualPadFromCotRow, gadgetMtaReceiverVerifyAndFinish, gadgetMtaSenderCreateMessage, getGadgetVector768, recombineGadgetBitsModN } from "./mta.mjs";
|
|
8
|
+
import { MpcPartyBaseOtChannels, MpcPublicClusterInfo, MtaInstanceKind, PresignMtaOtStep1Bundle, PresignMtaOtStep2Bundle, PresignMtaOtStep3Bundle, PresignMtaStep4PayloadBundle, PresignPartySession, PresignRound1CommitmentMsg, PresignRound1RevealMsg, PresignRound3BroadcastMsg, PresignRound4BroadcastMsg, PresignaturePublicVerification, PresignatureShareRecord, VolatilePresignaturePool, computeSubsetBoundPresigId } from "./presign.mjs";
|
|
9
|
+
import { MpcAggregatedSignature, MpcOnlineSignRequest, MpcOnlineSignShare, RerandomizedNonceResult, aggregateOnlineSignature, computeRerandomizedNoncePoint, createOnlineSignShare, deriveGrothShoupRerandScalar, evaluateConsumedPresigShareWithRerand, verifyAndDeriveRequestChildKey, verifyOnlineSignShare } from "./sign.mjs";
|
|
10
|
+
import { BIP44_ETH_STANDARD_PATH, Bip39TwentyFourthSiblingEntry, IdentifiedColdShare, decodeBip39Words24ToColdShare, deriveBip44EthAddressFromWords24, encodeColdShareToBip39Words24, enumerateValid24thBip39Siblings, guardianIndexToPlateLabel, identifyColdShareIndexViaFeldman } from "./steel-mnemonic.mjs";
|
|
11
|
+
import { CanaryActivationCert, CanaryChallengeBundle, CanaryChallengePeerApproval, ColdShardSchnorrPok, DecryptedGuardianColdShare, DirectBitElGamalVesPlugin, ParsedVesRecoveryPackage, PrintableManifestCard, VES_BITS_PER_CHUNK, VES_BITS_PER_SHARE, VES_BIT_RECORD_BYTES, VES_CHUNKS_PER_SHARE, VES_GUARDIAN_BUNDLE_BYTES, VES_LINEAR_DLEQ_BYTES, VES_MAX_LIMB_VALUE, VES_MAX_SUMMED_LIMB, aggregateRecoveryPackage, assembleCanaryActivationCert, assertChallengeBundleMatchesManifest, computeCanaryChallengeDigest32, createColdShardSchnorrPok, createNodeColdVesContribution, decryptGuardianColdShareBsgs, exportPrintableManifestCard, parseRecoveryPackageBytes, signCanaryChallengeApproval, solveDiscreteLogBsgs, validatePrintableManifestCard, verifyCanaryActivationCert, verifyCanaryChallengeBundle, verifyColdShardSchnorrPok, verifyManifestAgainstDkgConfig, verifyManifestAgainstRecoveryPackage, verifyNodeColdVesContribution, verifyRecoveryPackage } from "./ves-backup.mjs";
|
|
12
|
+
import { DecodedSignedEip1559Tx, EIP1559_TX_TYPE_BYTE, ERC20_TRANSFER_SELECTOR_HEX, Eip1559AccessListItem, Eip1559UnsignedTxFields, RlpInput, bigintToMinimalBytesBE, decodeAndRecoverSignedEip1559Tx, decodeErc20TransferCalldata, encodeErc20TransferCalldata, encodeSignedEip1559Tx, encodeUnsignedEip1559Tx, rlpDecode, rlpEncode } from "./rlp-eip1559.mjs";
|
|
13
|
+
import { ACTOR_KIND_AND_ALG_BYTE, ActorKindAndAlg, ActorSlotPairingBootstrapPackage, CanonicalPersonalOcapChainGasConfig, CanonicalPersonalVaultPolicy, DeviceShareEnvelope, ENTITLEMENT_TIER_CODE, ERC20_APPROVE_SELECTOR_HEX, EncryptedTargetActorShareBox, FirewallCommercialTier, FirewallRiskVerdict, GuardianQuorumProof, HARD_BANNED_PERSONAL_EVM_SELECTORS, HSM_SEALED_BLOB_CIPHERTEXT_BYTES, HSM_SEALED_BLOB_CIPHERTEXT_OFFSET, HSM_SEALED_BLOB_HEADER_BYTES, HSM_SEALED_BLOB_HEADER_MAC_OFFSET, HSM_SEALED_BLOB_HEADER_WITH_MAC_BYTES, HSM_SEALED_BLOB_IV_OFFSET, HSM_SEALED_BLOB_MAX_POLICY_UTF8_BYTES, HSM_SEALED_BLOB_TAG_OFFSET, HSM_SEALED_BLOB_VERSION, HsmSealedBlobHeaderFields, MAX_ANNOUNCE_VALIDITY_WINDOW_SEC, MIN_ANNOUNCE_VALIDITY_WINDOW_SEC, OfflineSweepItemSpec, PERSONAL_MAX_VELOCITY_UINT128, ParsedHsmSealedBlob, PersonalActorChallengeAction, PersonalActorSignature, PersonalAllowedContractRule, PersonalAssetTierLimits, PersonalBlobAadInput, PersonalChildDerivationInput, PersonalClearSigningPreview, PersonalColdRecoveryKitManifest, PersonalColdRecoveryPlatePublicInfo, PersonalCosignerResponderSession, PersonalCosignerTransport, PersonalEvmCallKind, PersonalMpcEoaSigner, PersonalOcapAssetTierLimits, PersonalOcapChainGasConfig, PersonalOnlineSignCosignerRequest, PersonalPolicyProofBundle, PersonalPolicyTier, PersonalPostConditions, PersonalPresignInitRequest, PersonalPresignInitResponse, PersonalPresignStepRequest, PersonalPresignStepResponse, PersonalPreviewCallKind, PersonalRoleRoster, PersonalSealEnrollActorPok, PersonalSignPayloadKind, PersonalSignTxOptions, PersonalSignedEip1559Result, PersonalVaultPolicy, PersonalWakePasswordKdfOptions, QuorumApproverAlg, QuorumApproverMember, QuorumMemberSignatureEntry, RoleQuorumProof, SignedAnnounceTicket, SignedFirewallAttestation, SignedOfflineSweepTx, SimulatedBalanceDelta, UNLIMITED_APPROVE_THRESHOLD, VaultEntitlementTicket, VaultEntitlementTier, VerifiedPersonalEip1559Tx, WebAuthnVerifyExpectedPolicy, actorKindAndAlgToByte, additiveToShamirSlot1Share, additiveToShamirSlot2Share, aes256GcmDecryptDetached, aes256GcmEncryptDetached, applyHsmSlotResplitDelta, assertNoEip7702Bytes, assertPersonalSlotNotExpired, base64UrlDecodeBytes, base64UrlEncodeBytes, bootstrapPersonalVaultClient, buildPersonalAnnounceChallengeDigest32, buildPersonalClearSigningPreview, buildPersonalEntitlementApplyChallengeDigest32, buildPersonalPairResplitChallengeDigest32, buildPersonalPresignInitChallengeDigest32, buildPersonalResealKidChallengeDigest32, buildPersonalRevokeSlotChallengeDigest32, buildPersonalSealEnrollChallengeDigest32, buildPersonalSessionLockChallengeDigest32, buildPersonalSessionOpenChallengeDigest32, buildPersonalSignChallengeDigest32, buildPersonalVaultClusterInfo, buildPersonalVetoChallengeDigest32, byteToActorKindAndAlg, canonicalizePersonalBlobAadBytes, canonicalizePersonalVaultPolicy, completeActorSlotPairingOnTarget, computeHsmSealedBlobHeaderMac32, computeNonDegenerateActorResplitShare, computePersonalActorChallengeDigest32, computePersonalClearSigningPreviewHash32, computePersonalPolicyHash32, computeSimulatedDeltaCommitment32, computeVaultEntitlementTicketDigest32, createActorSlotPairingBootstrap, createPersonalMpcEoaSigner, createPersonalSealEnrollActorPok, decodeAndVerifyPersonalEip1559Tx, decodeErc20ApproveCalldata, decodeHsmSealedBlobHeader319, decodeHsmSealedBlobInnerPlaintext3717, deriveBlindOcapVelocityTag32, deriveBlindSlotTag32, deriveBlindVaultTag32, deriveBlindVelocityTag32, deriveHsmPersonalSealKey32, derivePersonalVaultChildKey, derivePersonalWakePasswordKeys, encodeErc20ApproveCalldata, encodeHsmSealedBlobHeader319, encodeHsmSealedBlobInnerPlaintext3717, initiateActorSlotResplit, isAgentActorKind, normalizeActorPublicKeyToPadded65, normalizeCanonicalOcapTokenKey, normalizeMaxTokenOutflowsCaps, normalizeOcapAddressOrEth, openHsmInboundTransportBox, parseHsmSealedBlobHeader, recoverPersonalVaultRootOffline, resolveRequiredPolicyTier, runPersonalClientPresignWithTransport, sealDeviceShareEnvelope, sealHsmInboundTransportBox, signAnnounceTicket, signGuardianQuorumApproval, signPersonalActorChallenge, signPersonalFirewallAttestation, signPersonalVaultRecoverySweepOffline, signRoleQuorumApproval, signVaultEntitlementTicket, unsealDeviceShareEnvelope, unwrapSealedBlobFromCloudSync, validateActorPublicKeyPadded65, verifyActorSlotPairingBootstrap, verifyGuardianQuorumProof, verifyPersonalActorSignature, verifyPersonalAdditiveSplitMatchesRoot, verifyPersonalColdRecoveryKitManifest, verifyPersonalFirewallAttestation, verifyPersonalPolicyProofBundle, verifyPersonalSealEnrollActorPok, verifyPersonalSimulationBalanceDelta, verifyRoleQuorumProof, verifySignedAnnounceTicket, verifyVaultEntitlementTicket, wrapSealedBlobForCloudSync } from "./personal-vault.mjs";
|
|
14
|
+
import { CborTagValue, VerifiedPersonalArcblockJwt, VerifiedPersonalOcapTx, decodeAndVerifyPersonalArcblockJwt, decodeAndVerifyPersonalOcapTx, deriveOcapIdentitiesFromChildPoint, estimateOcapExecutionCostUpperBound, resolveRequiredOcapPolicyTier } from "./ocap-clear-signing.mjs";
|
|
15
|
+
import { DecryptToSteelResult, EmergencySweepSignedTx, GuardianKeypair, SweepChildSpec, decryptGuardianColdShareToSteelWords24, enforceSingleCustodianDecryptPerSession, generateGuardianKeypair, proveColdShardFromSteelWords24, sweepErc20Transfer, sweepEth } from "./offline-ceremony.mjs";
|
|
16
|
+
import { MAX_X402_ACCEPTS_ENTRIES, MAX_X402_CHALLENGE_BYTES, MAX_X402_RETRIES, ParsedX402PaymentChallenge, PolicyProofBundle, X402AgentPaymentFetchOptions, X402EscalationContext, X402EscalationKind, X402HeaderMap, X402PaymentProofPayload, X402PaymentRequirement, X402SyncResponseSnapshot, X402TxExecutionParams, X402_EXACT_EVM_TX_SCHEME, X402_PROTOCOL_VERSION, createX402AgentPaymentFetch, decodeX402PaymentHeader, encodeX402PaymentHeader, parseX402PaymentChallenge } from "./x402-agent-guard.mjs";
|
|
17
|
+
export { ACTOR_KIND_AND_ALG_BYTE, ActorKindAndAlg, ActorSlotPairingBootstrapPackage, AppendOnlyDkgEchoLock, BIP39_ENGLISH_WORDLIST, BIP39_ENGLISH_WORD_TO_INDEX, BIP44_ETH_STANDARD_PATH, BLIND_SLOT_RECORD_BYTES, BSGS_M, BaseOtReceiverState, BaseOtSenderPendingSession, BaseOtSenderState, BaseOtStep1Message, BaseOtStep2Message, Bip39TwentyFourthSiblingEntry, CANONICAL_BIP39_ENGLISH_SHA256_HEX, CLOUD_SYNC_SEALED_BLOB_BYTES, CanaryActivationCert, CanaryChallengeBundle, CanaryChallengePeerApproval, CanonicalPersonalOcapChainGasConfig, CanonicalPersonalVaultPolicy, CborTagValue, ColdBackupDealerInput, ColdBackupPlugin, ColdShardSchnorrPok, DEFAULT_COLD_GUARDIANS, DEFAULT_COLD_THRESHOLD, DEFAULT_ONLINE_PARTIES, DEFAULT_ONLINE_THRESHOLD, DST_BASEOT_KEY_V1, DST_BASEOT_S_POK_V1, DST_CANARY_CHALLENGE_V1, DST_CANARY_SHARD_POK_V1, DST_CHILD_TWEAK_V1, DST_COT_ROW_V1, DST_DKG_COM_V2, DST_DKG_CTX_V2, DST_DKG_ECHO_V2, DST_DKG_POK_V2, DST_DKG_SELFTEST_V2, DST_DKG_SHARE_AAD_V2, DST_DKG_STEP1_AUTH_V1, DST_DKG_TRANSCRIPT_V2, DST_DKG_X25519_HKDF_V2, DST_EMERGENCY_SWEEP_NONCE_V1, DST_KOS15_CHI_V1, DST_LHL_GADGET_V1, DST_MTA_ETA_V1, DST_OT_CTR_IV_V1, DST_PERSONAL_ANNOUNCE_TICKET_V1, DST_PERSONAL_BASEOT_CTX_V1, DST_PERSONAL_BLIND_OCAP_VELOCITY_TAG_V1, DST_PERSONAL_BLIND_SLOT_TAG_V1, DST_PERSONAL_BLIND_VAULT_TAG_V1, DST_PERSONAL_BLIND_VELOCITY_TAG_V1, DST_PERSONAL_BLOB_AAD_V1, DST_PERSONAL_BLOB_MAGIC, DST_PERSONAL_CHALLENGE_ANNOUNCE_V1, DST_PERSONAL_CHALLENGE_ENTITLEMENT_APPLY_V1, DST_PERSONAL_CHALLENGE_PAIR_RESPLIT_V1, DST_PERSONAL_CHALLENGE_PRESIGN_INIT_V1, DST_PERSONAL_CHALLENGE_RESEAL_KID_V1, DST_PERSONAL_CHALLENGE_REVOKE_SLOT_V1, DST_PERSONAL_CHALLENGE_SEAL_ENROLL_V1, DST_PERSONAL_CHALLENGE_SESSION_LOCK_V1, DST_PERSONAL_CHALLENGE_SESSION_OPEN_V1, DST_PERSONAL_CHALLENGE_SIGN_V1, DST_PERSONAL_CHALLENGE_VETO_V1, DST_PERSONAL_CLEAR_PREVIEW_V1, DST_PERSONAL_CLOUD_BLOB_V1, DST_PERSONAL_CLOUD_SYNC_V1, DST_PERSONAL_CLUSTER_HDKG_V1, DST_PERSONAL_COLD_MANIFEST_V1, DST_PERSONAL_DEVICE_AAD_V1, DST_PERSONAL_DEVICE_ENV_V1, DST_PERSONAL_ENTITLEMENT_TICKET_V1, DST_PERSONAL_FIREWALL_ATTESTATION_V1, DST_PERSONAL_GUARDIAN_QUORUM_V1, DST_PERSONAL_PAIR_POP_V1, DST_PERSONAL_PAIR_SHARE_AAD_V1, DST_PERSONAL_PAIR_SHARE_BOX_V1, DST_PERSONAL_POLICY_V1, DST_PERSONAL_PWD_CLIENT_HKDF_V1, DST_PERSONAL_PWD_HSM_HKDF_V1, DST_PERSONAL_ROLE_QUORUM_V1, DST_PERSONAL_SEAL_ENROLL_ACTOR_POK_V1, DST_PERSONAL_SEAL_KEY_V1, DST_PERSONAL_SEAL_SALT_V1, DST_PERSONAL_SIMULATED_DELTA_V1, DST_PERSONAL_TRANSPORT_AAD_V1, DST_PERSONAL_TRANSPORT_BOX_V1, DST_PRESIG_COM_V1, DST_PRESIG_ID_V1, DST_PRESIG_PI_LIN_K_V1, DST_PRESIG_PI_POK_Z_V1, DST_PRESIG_POK_B_V1, DST_PRESIG_POK_CK_V1, DST_PRESIG_POK_GAMMA_V1, DST_PRESIG_RERAND_V1, DST_PRESIG_ZETA_HKDF_V1, DST_PRESIG_ZETA_V1, DST_RULE_TWEAK_V1, DST_VES_BIT_OR_V1, DST_VES_CHUNK_LIN_V1, DecodedSignedEip1559Tx, DecryptToSteelResult, DecryptedGuardianColdShare, DerivedChildKey, DeviceShareEnvelope, DirectBitElGamalVesPlugin, DkgCeremonyConfig, DkgEchoLock, DkgEncryptedShareEnvelope, DkgParticipantSession, DkgRosterEntry, DkgRound1CommitMessage, DkgRound2RevealPayload, DkgRound3EchoMessage, DkgSubsetSelfTestSignature, EIP1559_TX_TYPE_BYTE, ENTITLEMENT_TIER_CODE, ERC20_APPROVE_SELECTOR_HEX, ERC20_TRANSFER_SELECTOR_HEX, ESCAPE_DRILL_MAX_AGE_SECONDS, Eip1559AccessListItem, Eip1559UnsignedTxFields, EmergencySweepSignedTx, EncryptedTargetActorShareBox, FORBIDDEN_ONLINE_ROLE_ESCAPE_CANARY, FirewallCommercialTier, FirewallRiskVerdict, Fn, GadgetMtaPayload, GuardianKeypair, GuardianQuorumProof, HARD_BANNED_PERSONAL_EVM_SELECTORS, HSM_SEALED_BLOB_BYTES, HSM_SEALED_BLOB_CIPHERTEXT_BYTES, HSM_SEALED_BLOB_CIPHERTEXT_OFFSET, HSM_SEALED_BLOB_HEADER_BYTES, HSM_SEALED_BLOB_HEADER_MAC_OFFSET, HSM_SEALED_BLOB_HEADER_WITH_MAC_BYTES, HSM_SEALED_BLOB_IV_OFFSET, HSM_SEALED_BLOB_MAX_POLICY_UTF8_BYTES, HSM_SEALED_BLOB_TAG_OFFSET, HSM_SEALED_BLOB_VERSION, H_scalar, HsmSealedBlobHeaderFields, IdentifiedColdShare, LinearPedersenDleqProof, MAX_ACTIVE_PRESIGN_SESSIONS, MAX_ANNOUNCE_VALIDITY_WINDOW_SEC, MAX_BLIND_RECORDS, MAX_MPC_CLUSTER_NODES, MAX_MPC_PEER_MESSAGE_BYTES, MAX_MPC_SIGN_REQUEST_BYTES, MAX_ON_DEMAND_SILENCE_SECONDS, MAX_PERSONAL_CALL_DEPTH, MAX_PERSONAL_FIREWALL_ATTESTATION_TTL_SECONDS, MAX_PERSONAL_HTTP_BODY_BYTES, MAX_PERSONAL_JSON_DEPTH, MAX_PERSONAL_JWT_TTL_SECONDS, MAX_PERSONAL_JWT_UNSIGNED_BYTES, MAX_PERSONAL_OCAP_CBOR_DEPTH, MAX_PERSONAL_OCAP_DELEGATE_TTL_SECONDS, MAX_PERSONAL_OCAP_TX_BYTES, MAX_PERSONAL_TX_DATA_BYTES, MAX_RECOVERY_PACKAGE_BYTES, MAX_RULE_DAG_NODES, MAX_RULE_YAML_BYTES, MAX_TRAVEL_SESSION_TTL_SECONDS, MAX_X402_ACCEPTS_ENTRIES, MAX_X402_CHALLENGE_BYTES, MAX_X402_RETRIES, MIN_ANNOUNCE_VALIDITY_WINDOW_SEC, MPC_PROTOCOL_VERSION, type MpcAggregatedSignature, MpcChildDerivationSpec, MpcErrorCode, MpcNodeProvisionedKeyRecord, type MpcOnlineSignRequest, type MpcOnlineSignShare, MpcPartyBaseOtChannels, MpcProtocolError, MpcPublicClusterInfo, MpcRootLifecycleState, MpcTweakMode, MtaInstanceKind, OT_BASE_PARTIAL_BITS, OT_COLUMN_BYTES, OT_EXTENSION_ROWS, OT_GADGET_BITS, OT_KAPPA_BITS, OT_KAPPA_BYTES, OT_LHL_EXTRA_BITS, OT_SACRIFICE_BITS, OcapConsensusAnchor, OfflineSweepItemSpec, OtExtReceiverPendingState, OtExtSenderPendingState, OtExtStep1Message, OtExtStep2Message, OtExtStep3Message, PEDERSEN_H, PEDERSEN_H_COMP33, PEDERSEN_H_COMPRESSED_HEX, PEDERSEN_H_DST, PEDERSEN_H_MESSAGE, PERSONAL_MAX_VELOCITY_UINT128, PERSONAL_PRESIG_TTL_SECONDS, ParsedHsmSealedBlob, ParsedVesRecoveryPackage, ParsedX402PaymentChallenge, PedersenPokProof, PersonalActorChallengeAction, PersonalActorSignature, PersonalAllowedContractRule, PersonalAssetTierLimits, PersonalBlobAadInput, PersonalChildDerivationInput, PersonalClearSigningPreview, PersonalColdRecoveryKitManifest, PersonalColdRecoveryPlatePublicInfo, PersonalCosignerResponderSession, PersonalCosignerTransport, PersonalEvmCallKind, PersonalMpcEoaSigner, PersonalOcapAssetTierLimits, PersonalOcapChainGasConfig, PersonalOnlineSignCosignerRequest, PersonalPolicyProofBundle, PersonalPolicyTier, PersonalPostConditions, PersonalPresignInitRequest, PersonalPresignInitResponse, PersonalPresignStepRequest, PersonalPresignStepResponse, PersonalPreviewCallKind, PersonalRoleRoster, PersonalSealEnrollActorPok, PersonalSignPayloadKind, PersonalSignTxOptions, PersonalSignedEip1559Result, PersonalVaultPolicy, PersonalWakePasswordKdfOptions, PolicyProofBundle, PresignMtaOtStep1Bundle, PresignMtaOtStep2Bundle, PresignMtaOtStep3Bundle, PresignMtaStep4PayloadBundle, PresignPartySession, PresignRound1CommitmentMsg, PresignRound1RevealMsg, PresignRound3BroadcastMsg, PresignRound4BroadcastMsg, PresignaturePublicVerification, PresignatureShareRecord, PrintableManifestCard, QuorumApproverAlg, QuorumApproverMember, QuorumMemberSignatureEntry, RandomBytesFn, type RerandomizedNonceResult, RlpInput, RoleQuorumProof, SECP256K1_G, SECP256K1_HALF_N, SECP256K1_N, SECP256K1_P, SECP256K1_ZERO, SchnorrPokProof, Secp256k1Point, SignedAnnounceTicket, SignedFirewallAttestation, SignedOfflineSweepTx, SimulatedBalanceDelta, SweepChildSpec, UNLIMITED_APPROVE_THRESHOLD, VES_BITS_PER_CHUNK, VES_BITS_PER_SHARE, VES_BIT_RECORD_BYTES, VES_CHUNKS_PER_SHARE, VES_GUARDIAN_BUNDLE_BYTES, VES_LINEAR_DLEQ_BYTES, VES_MAX_LIMB_VALUE, VES_MAX_SUMMED_LIMB, VaultEntitlementTicket, VaultEntitlementTier, VerifiedCotReceiverRows, VerifiedCotSenderRows, VerifiedPersonalArcblockJwt, VerifiedPersonalEip1559Tx, VerifiedPersonalOcapTx, VolatilePresignaturePool, WebAuthnVerifyExpectedPolicy, X402AgentPaymentFetchOptions, X402EscalationContext, X402EscalationKind, X402HeaderMap, X402PaymentProofPayload, X402PaymentRequirement, X402SyncResponseSnapshot, X402TxExecutionParams, X402_EXACT_EVM_TX_SCHEME, X402_PROTOCOL_VERSION, actorKindAndAlgToByte, addModN, additiveToShamirSlot1Share, additiveToShamirSlot2Share, aes256EncryptBlock, aes256GcmDecryptDetached, aes256GcmEncryptDetached, aggregateOnlineSignature, aggregateRecoveryPackage, applyAdditiveTweak, applyHsmSlotResplitDelta, assembleCanaryActivationCert, assertAllowedOnlineRole, assertChallengeBundleMatchesManifest, assertNoEip7702Bytes, assertPersonalSlotNotExpired, assertSafeCeremonyId, assertScalarInField, assertScalarNonZero, assertValidX25519PublicKey, base64UrlDecodeBytes, base64UrlEncodeBytes, baseOtReceiverStep2, baseOtSenderStep1, baseOtSenderStep3, bigintToMinimalBytesBE, bootstrapPersonalVaultClient, buildPersonalAnnounceChallengeDigest32, buildPersonalClearSigningPreview, buildPersonalEntitlementApplyChallengeDigest32, buildPersonalPairResplitChallengeDigest32, buildPersonalPresignInitChallengeDigest32, buildPersonalResealKidChallengeDigest32, buildPersonalRevokeSlotChallengeDigest32, buildPersonalSealEnrollChallengeDigest32, buildPersonalSessionLockChallengeDigest32, buildPersonalSessionOpenChallengeDigest32, buildPersonalSignChallengeDigest32, buildPersonalVaultClusterInfo, buildPersonalVetoChallengeDigest32, byteToActorKindAndAlg, bytes16ToU128LE, bytes32ToScalarNonZero, bytes32ToScalarStrict, bytesToBigIntBE, bytesToHex, canonicalizePersonalBlobAadBytes, canonicalizePersonalVaultPolicy, completeActorSlotPairingOnTarget, computeCanaryChallengeDigest32, computeDkgContextHash32, computeDkgSubsetSelfTestDigest32, computeHsmSealedBlobHeaderMac32, computeNonDegenerateActorResplitShare, computePersonalActorChallengeDigest32, computePersonalClearSigningPreviewHash32, computePersonalPolicyHash32, computeRerandomizedNoncePoint, computeSimulatedDeltaCommitment32, computeSubsetBoundPresigId, computeVaultEntitlementTicketDigest32, computeX25519SharedSecret, concatBytes, constantTimeEqual, createActorSlotPairingBootstrap, createColdShardSchnorrPok, createLinearPedersenDleqProof, createNodeColdVesContribution, createOnlineSignShare, createPedersenPok, createPersonalMpcEoaSigner, createPersonalSealEnrollActorPok, createSchnorrPokInBase, createX402AgentPaymentFetch, decodeAndRecoverSignedEip1559Tx, decodeAndVerifyPersonalArcblockJwt, decodeAndVerifyPersonalEip1559Tx, decodeAndVerifyPersonalOcapTx, decodeBip39Words24ToColdShare, decodeErc20ApproveCalldata, decodeErc20TransferCalldata, decodeHsmSealedBlobHeader319, decodeHsmSealedBlobInnerPlaintext3717, decodePointCompressed, decodeX402PaymentHeader, decomposeScalarWithLhlGadget, decryptGuardianColdShareBsgs, decryptGuardianColdShareToSteelWords24, defaultRandomBytes, deriveBip44EthAddressFromWords24, deriveBlindOcapVelocityTag32, deriveBlindSlotTag32, deriveBlindVaultTag32, deriveBlindVelocityTag32, deriveDualPadFromCotRow, deriveGrothShoupRerandScalar, deriveHsmPersonalSealKey32, deriveOcapIdentitiesFromChildPoint, derivePersonalVaultChildKey, derivePersonalWakePasswordKeys, deriveRoleBoundChild, deriveRuleBoundChild, deriveUntweakedChild, ecrecoverEthAddress, eklundhTranspose128x1024, encodeColdShareToBip39Words24, encodeErc20ApproveCalldata, encodeErc20TransferCalldata, encodeHsmSealedBlobHeader319, encodeHsmSealedBlobInnerPlaintext3717, encodePointCompressed, encodeSignedEip1559Tx, encodeUnsignedEip1559Tx, encodeX402PaymentHeader, enforceSingleCustodianDecryptPerSession, enumerateCombinations, enumerateValid24thBip39Siblings, estimateOcapExecutionCostUpperBound, evaluateConsumedPresigShareWithRerand, evaluateFeldmanCommitments, evaluatePolynomialModN, expandColumnPrgAes256Ctr, expandKos15ChiWeights, exportPrintableManifestCard, gadgetMtaReceiverVerifyAndFinish, gadgetMtaSenderCreateMessage, generateGuardianKeypair, getGadgetVector768, gf128Mul, guardianIndexToPlateLabel, hashTranscriptSha256, hexToBytes, identifyColdShareIndexViaFeldman, initiateActorSlotResplit, invModN, isAgentActorKind, lagrangeCoefficientAtZero, lengthPrefixedEncode, modN, mulBaseG, mulModN, mulPoint, negModN, normalizeActorPublicKeyToPadded65, normalizeCanonicalOcapTokenKey, normalizeHexBytes, normalizeMaxTokenOutflowsCaps, normalizeOcapAddressOrEth, normalizeSortedSubset, openHsmInboundTransportBox, otExtendReceiverStep1, otExtendReceiverStep3, otExtendSenderStep2, otExtendSenderStep4VerifyBeforePads, parseHsmSealedBlobHeader, parseRecoveryPackageBytes, parseStrictEthAddress, parseX402PaymentChallenge, pedersenCommit, pointToEthAddress, promoteNodeRecordAfterSelfTests, proveColdShardFromSteelWords24, recombineGadgetBitsModN, recoverPersonalVaultRootOffline, resolveRequiredOcapPolicyTier, resolveRequiredPolicyTier, rlpDecode, rlpEncode, runPersonalClientPresignWithTransport, sampleScalarNonZero, scalarToBytes32, sealDeviceShareEnvelope, sealHsmInboundTransportBox, secp256k1, signAnnounceTicket, signCanaryChallengeApproval, signGuardianQuorumApproval, signPersonalActorChallenge, signPersonalFirewallAttestation, signPersonalVaultRecoverySweepOffline, signRoleQuorumApproval, signVaultEntitlementTicket, solveDiscreteLogBsgs, sortedSubsetBytes, subModN, subsetsEqual, sweepErc20Transfer, sweepEth, toEip55ChecksumAddress, u128ToBytes16LE, u16be, u32be, u64be, u8, unsealDeviceShareEnvelope, unwrapSealedBlobFromCloudSync, utf8Bytes, validateActorPublicKeyPadded65, validateAndComputeDkgContext, validatePrintableManifestCard, verifyActorSlotPairingBootstrap, verifyAndDeriveRequestChildKey, verifyCanaryActivationCert, verifyCanaryChallengeBundle, verifyColdShardSchnorrPok, verifyGuardianQuorumProof, verifyLinearPedersenDleqProof, verifyManifestAgainstDkgConfig, verifyManifestAgainstRecoveryPackage, verifyNodeColdVesContribution, verifyOnlineSignShare, verifyPedersenPok, verifyPersonalActorSignature, verifyPersonalAdditiveSplitMatchesRoot, verifyPersonalColdRecoveryKitManifest, verifyPersonalFirewallAttestation, verifyPersonalPolicyProofBundle, verifyPersonalSealEnrollActorPok, verifyPersonalSimulationBalanceDelta, verifyRecoveryPackage, verifyRoleQuorumProof, verifySchnorrPokInBase, verifySignedAnnounceTicket, verifyVaultEntitlementTicket, wipeBaseOtReceiverState, wipeBaseOtSenderState, wipeVerifiedCotReceiverRows, wipeVerifiedCotSenderRows, wrapSealedBlobForCloudSync, zeroizeBytes };
|
package/esm/index.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BLIND_SLOT_RECORD_BYTES, BSGS_M, CLOUD_SYNC_SEALED_BLOB_BYTES, DEFAULT_COLD_GUARDIANS, DEFAULT_COLD_THRESHOLD, DEFAULT_ONLINE_PARTIES, DEFAULT_ONLINE_THRESHOLD, DST_BASEOT_KEY_V1, DST_BASEOT_S_POK_V1, DST_CANARY_CHALLENGE_V1, DST_CANARY_SHARD_POK_V1, DST_CHILD_TWEAK_V1, DST_COT_ROW_V1, DST_DKG_COM_V2, DST_DKG_CTX_V2, DST_DKG_ECHO_V2, DST_DKG_POK_V2, DST_DKG_SELFTEST_V2, DST_DKG_SHARE_AAD_V2, DST_DKG_STEP1_AUTH_V1, DST_DKG_TRANSCRIPT_V2, DST_DKG_X25519_HKDF_V2, DST_EMERGENCY_SWEEP_NONCE_V1, DST_KOS15_CHI_V1, DST_LHL_GADGET_V1, DST_MTA_ETA_V1, DST_OT_CTR_IV_V1, DST_PERSONAL_ANNOUNCE_TICKET_V1, DST_PERSONAL_BASEOT_CTX_V1, DST_PERSONAL_BLIND_OCAP_VELOCITY_TAG_V1, DST_PERSONAL_BLIND_SLOT_TAG_V1, DST_PERSONAL_BLIND_VAULT_TAG_V1, DST_PERSONAL_BLIND_VELOCITY_TAG_V1, DST_PERSONAL_BLOB_AAD_V1, DST_PERSONAL_BLOB_MAGIC, DST_PERSONAL_CHALLENGE_ANNOUNCE_V1, DST_PERSONAL_CHALLENGE_ENTITLEMENT_APPLY_V1, DST_PERSONAL_CHALLENGE_PAIR_RESPLIT_V1, DST_PERSONAL_CHALLENGE_PRESIGN_INIT_V1, DST_PERSONAL_CHALLENGE_RESEAL_KID_V1, DST_PERSONAL_CHALLENGE_REVOKE_SLOT_V1, DST_PERSONAL_CHALLENGE_SEAL_ENROLL_V1, DST_PERSONAL_CHALLENGE_SESSION_LOCK_V1, DST_PERSONAL_CHALLENGE_SESSION_OPEN_V1, DST_PERSONAL_CHALLENGE_SIGN_V1, DST_PERSONAL_CHALLENGE_VETO_V1, DST_PERSONAL_CLEAR_PREVIEW_V1, DST_PERSONAL_CLOUD_BLOB_V1, DST_PERSONAL_CLOUD_SYNC_V1, DST_PERSONAL_CLUSTER_HDKG_V1, DST_PERSONAL_COLD_MANIFEST_V1, DST_PERSONAL_DEVICE_AAD_V1, DST_PERSONAL_DEVICE_ENV_V1, DST_PERSONAL_ENTITLEMENT_TICKET_V1, DST_PERSONAL_FIREWALL_ATTESTATION_V1, DST_PERSONAL_GUARDIAN_QUORUM_V1, DST_PERSONAL_PAIR_POP_V1, DST_PERSONAL_PAIR_SHARE_AAD_V1, DST_PERSONAL_PAIR_SHARE_BOX_V1, DST_PERSONAL_POLICY_V1, DST_PERSONAL_PWD_CLIENT_HKDF_V1, DST_PERSONAL_PWD_HSM_HKDF_V1, DST_PERSONAL_ROLE_QUORUM_V1, DST_PERSONAL_SEAL_ENROLL_ACTOR_POK_V1, DST_PERSONAL_SEAL_KEY_V1, DST_PERSONAL_SEAL_SALT_V1, DST_PERSONAL_SIMULATED_DELTA_V1, DST_PERSONAL_TRANSPORT_AAD_V1, DST_PERSONAL_TRANSPORT_BOX_V1, DST_PRESIG_COM_V1, DST_PRESIG_ID_V1, DST_PRESIG_PI_LIN_K_V1, DST_PRESIG_PI_POK_Z_V1, DST_PRESIG_POK_B_V1, DST_PRESIG_POK_CK_V1, DST_PRESIG_POK_GAMMA_V1, DST_PRESIG_RERAND_V1, DST_PRESIG_ZETA_HKDF_V1, DST_PRESIG_ZETA_V1, DST_RULE_TWEAK_V1, DST_VES_BIT_OR_V1, DST_VES_CHUNK_LIN_V1, ESCAPE_DRILL_MAX_AGE_SECONDS, FORBIDDEN_ONLINE_ROLE_ESCAPE_CANARY, HSM_SEALED_BLOB_BYTES, MAX_ACTIVE_PRESIGN_SESSIONS, MAX_BLIND_RECORDS, MAX_MPC_CLUSTER_NODES, MAX_MPC_PEER_MESSAGE_BYTES, MAX_MPC_SIGN_REQUEST_BYTES, MAX_ON_DEMAND_SILENCE_SECONDS, MAX_PERSONAL_CALL_DEPTH, MAX_PERSONAL_FIREWALL_ATTESTATION_TTL_SECONDS, MAX_PERSONAL_HTTP_BODY_BYTES, MAX_PERSONAL_JSON_DEPTH, MAX_PERSONAL_JWT_TTL_SECONDS, MAX_PERSONAL_JWT_UNSIGNED_BYTES, MAX_PERSONAL_OCAP_CBOR_DEPTH, MAX_PERSONAL_OCAP_DELEGATE_TTL_SECONDS, MAX_PERSONAL_OCAP_TX_BYTES, MAX_PERSONAL_TX_DATA_BYTES, MAX_RECOVERY_PACKAGE_BYTES, MAX_RULE_DAG_NODES, MAX_RULE_YAML_BYTES, MAX_TRAVEL_SESSION_TTL_SECONDS, MPC_PROTOCOL_VERSION, MpcProtocolError, OT_BASE_PARTIAL_BITS, OT_COLUMN_BYTES, OT_EXTENSION_ROWS, OT_GADGET_BITS, OT_KAPPA_BITS, OT_KAPPA_BYTES, OT_LHL_EXTRA_BITS, OT_SACRIFICE_BITS, PEDERSEN_H_COMPRESSED_HEX, PEDERSEN_H_DST, PEDERSEN_H_MESSAGE, PERSONAL_PRESIG_TTL_SECONDS, SECP256K1_HALF_N, SECP256K1_N, SECP256K1_P } from "./constants.mjs";
|
|
2
|
+
import { Fn, H_scalar, PEDERSEN_H, PEDERSEN_H_COMP33, SECP256K1_G, SECP256K1_ZERO, addModN, assertScalarInField, assertScalarNonZero, assertValidX25519PublicKey, bytes32ToScalarNonZero, bytes32ToScalarStrict, bytesToBigIntBE, bytesToHex, computeX25519SharedSecret, concatBytes, constantTimeEqual, createLinearPedersenDleqProof, createPedersenPok, createSchnorrPokInBase, decodePointCompressed, defaultRandomBytes, encodePointCompressed, enumerateCombinations, evaluateFeldmanCommitments, evaluatePolynomialModN, hashTranscriptSha256, hexToBytes, invModN, lagrangeCoefficientAtZero, lengthPrefixedEncode, modN, mulBaseG, mulModN, mulPoint, negModN, normalizeHexBytes, normalizeSortedSubset, pedersenCommit, sampleScalarNonZero, scalarToBytes32, secp256k1, sortedSubsetBytes, subModN, subsetsEqual, u16be, u32be, u64be, u8, utf8Bytes, verifyLinearPedersenDleqProof, verifyPedersenPok, verifySchnorrPokInBase, zeroizeBytes } from "./secp256k1-scalar.mjs";
|
|
3
|
+
import { BIP39_ENGLISH_WORDLIST, BIP39_ENGLISH_WORD_TO_INDEX, CANONICAL_BIP39_ENGLISH_SHA256_HEX } from "./bip39-english-wordlist.mjs";
|
|
4
|
+
import { applyAdditiveTweak, assertAllowedOnlineRole, deriveRoleBoundChild, deriveRuleBoundChild, deriveUntweakedChild, ecrecoverEthAddress, parseStrictEthAddress, pointToEthAddress, toEip55ChecksumAddress } from "./tweak.mjs";
|
|
5
|
+
import { AppendOnlyDkgEchoLock, DkgParticipantSession, assertSafeCeremonyId, computeDkgContextHash32, computeDkgSubsetSelfTestDigest32, promoteNodeRecordAfterSelfTests, validateAndComputeDkgContext } from "./dkg.mjs";
|
|
6
|
+
import { aes256EncryptBlock, baseOtReceiverStep2, baseOtSenderStep1, baseOtSenderStep3, bytes16ToU128LE, eklundhTranspose128x1024, expandColumnPrgAes256Ctr, expandKos15ChiWeights, gf128Mul, otExtendReceiverStep1, otExtendReceiverStep3, otExtendSenderStep2, otExtendSenderStep4VerifyBeforePads, u128ToBytes16LE, wipeBaseOtReceiverState, wipeBaseOtSenderState, wipeVerifiedCotReceiverRows, wipeVerifiedCotSenderRows } from "./ot.mjs";
|
|
7
|
+
import { decomposeScalarWithLhlGadget, deriveDualPadFromCotRow, gadgetMtaReceiverVerifyAndFinish, gadgetMtaSenderCreateMessage, getGadgetVector768, recombineGadgetBitsModN } from "./mta.mjs";
|
|
8
|
+
import { PresignPartySession, VolatilePresignaturePool, computeSubsetBoundPresigId } from "./presign.mjs";
|
|
9
|
+
import { aggregateOnlineSignature, computeRerandomizedNoncePoint, createOnlineSignShare, deriveGrothShoupRerandScalar, evaluateConsumedPresigShareWithRerand, verifyAndDeriveRequestChildKey, verifyOnlineSignShare } from "./sign.mjs";
|
|
10
|
+
import { BIP44_ETH_STANDARD_PATH, decodeBip39Words24ToColdShare, deriveBip44EthAddressFromWords24, encodeColdShareToBip39Words24, enumerateValid24thBip39Siblings, guardianIndexToPlateLabel, identifyColdShareIndexViaFeldman } from "./steel-mnemonic.mjs";
|
|
11
|
+
import { DirectBitElGamalVesPlugin, VES_BITS_PER_CHUNK, VES_BITS_PER_SHARE, VES_BIT_RECORD_BYTES, VES_CHUNKS_PER_SHARE, VES_GUARDIAN_BUNDLE_BYTES, VES_LINEAR_DLEQ_BYTES, VES_MAX_LIMB_VALUE, VES_MAX_SUMMED_LIMB, aggregateRecoveryPackage, assembleCanaryActivationCert, assertChallengeBundleMatchesManifest, computeCanaryChallengeDigest32, createColdShardSchnorrPok, createNodeColdVesContribution, decryptGuardianColdShareBsgs, exportPrintableManifestCard, parseRecoveryPackageBytes, signCanaryChallengeApproval, solveDiscreteLogBsgs, validatePrintableManifestCard, verifyCanaryActivationCert, verifyCanaryChallengeBundle, verifyColdShardSchnorrPok, verifyManifestAgainstDkgConfig, verifyManifestAgainstRecoveryPackage, verifyNodeColdVesContribution, verifyRecoveryPackage } from "./ves-backup.mjs";
|
|
12
|
+
import { EIP1559_TX_TYPE_BYTE, ERC20_TRANSFER_SELECTOR_HEX, bigintToMinimalBytesBE, decodeAndRecoverSignedEip1559Tx, decodeErc20TransferCalldata, encodeErc20TransferCalldata, encodeSignedEip1559Tx, encodeUnsignedEip1559Tx, rlpDecode, rlpEncode } from "./rlp-eip1559.mjs";
|
|
13
|
+
import { ACTOR_KIND_AND_ALG_BYTE, ENTITLEMENT_TIER_CODE, ERC20_APPROVE_SELECTOR_HEX, HARD_BANNED_PERSONAL_EVM_SELECTORS, HSM_SEALED_BLOB_CIPHERTEXT_BYTES, HSM_SEALED_BLOB_CIPHERTEXT_OFFSET, HSM_SEALED_BLOB_HEADER_BYTES, HSM_SEALED_BLOB_HEADER_MAC_OFFSET, HSM_SEALED_BLOB_HEADER_WITH_MAC_BYTES, HSM_SEALED_BLOB_IV_OFFSET, HSM_SEALED_BLOB_MAX_POLICY_UTF8_BYTES, HSM_SEALED_BLOB_TAG_OFFSET, HSM_SEALED_BLOB_VERSION, MAX_ANNOUNCE_VALIDITY_WINDOW_SEC, MIN_ANNOUNCE_VALIDITY_WINDOW_SEC, PERSONAL_MAX_VELOCITY_UINT128, PersonalCosignerResponderSession, UNLIMITED_APPROVE_THRESHOLD, actorKindAndAlgToByte, additiveToShamirSlot1Share, additiveToShamirSlot2Share, aes256GcmDecryptDetached, aes256GcmEncryptDetached, applyHsmSlotResplitDelta, assertNoEip7702Bytes, assertPersonalSlotNotExpired, base64UrlDecodeBytes, base64UrlEncodeBytes, bootstrapPersonalVaultClient, buildPersonalAnnounceChallengeDigest32, buildPersonalClearSigningPreview, buildPersonalEntitlementApplyChallengeDigest32, buildPersonalPairResplitChallengeDigest32, buildPersonalPresignInitChallengeDigest32, buildPersonalResealKidChallengeDigest32, buildPersonalRevokeSlotChallengeDigest32, buildPersonalSealEnrollChallengeDigest32, buildPersonalSessionLockChallengeDigest32, buildPersonalSessionOpenChallengeDigest32, buildPersonalSignChallengeDigest32, buildPersonalVaultClusterInfo, buildPersonalVetoChallengeDigest32, byteToActorKindAndAlg, canonicalizePersonalBlobAadBytes, canonicalizePersonalVaultPolicy, completeActorSlotPairingOnTarget, computeHsmSealedBlobHeaderMac32, computeNonDegenerateActorResplitShare, computePersonalActorChallengeDigest32, computePersonalClearSigningPreviewHash32, computePersonalPolicyHash32, computeSimulatedDeltaCommitment32, computeVaultEntitlementTicketDigest32, createActorSlotPairingBootstrap, createPersonalMpcEoaSigner, createPersonalSealEnrollActorPok, decodeAndVerifyPersonalEip1559Tx, decodeErc20ApproveCalldata, decodeHsmSealedBlobHeader319, decodeHsmSealedBlobInnerPlaintext3717, deriveBlindOcapVelocityTag32, deriveBlindSlotTag32, deriveBlindVaultTag32, deriveBlindVelocityTag32, deriveHsmPersonalSealKey32, derivePersonalVaultChildKey, derivePersonalWakePasswordKeys, encodeErc20ApproveCalldata, encodeHsmSealedBlobHeader319, encodeHsmSealedBlobInnerPlaintext3717, initiateActorSlotResplit, isAgentActorKind, normalizeActorPublicKeyToPadded65, normalizeCanonicalOcapTokenKey, normalizeMaxTokenOutflowsCaps, normalizeOcapAddressOrEth, openHsmInboundTransportBox, parseHsmSealedBlobHeader, recoverPersonalVaultRootOffline, resolveRequiredPolicyTier, runPersonalClientPresignWithTransport, sealDeviceShareEnvelope, sealHsmInboundTransportBox, signAnnounceTicket, signGuardianQuorumApproval, signPersonalActorChallenge, signPersonalFirewallAttestation, signPersonalVaultRecoverySweepOffline, signRoleQuorumApproval, signVaultEntitlementTicket, unsealDeviceShareEnvelope, unwrapSealedBlobFromCloudSync, validateActorPublicKeyPadded65, verifyActorSlotPairingBootstrap, verifyGuardianQuorumProof, verifyPersonalActorSignature, verifyPersonalAdditiveSplitMatchesRoot, verifyPersonalColdRecoveryKitManifest, verifyPersonalFirewallAttestation, verifyPersonalPolicyProofBundle, verifyPersonalSealEnrollActorPok, verifyPersonalSimulationBalanceDelta, verifyRoleQuorumProof, verifySignedAnnounceTicket, verifyVaultEntitlementTicket, wrapSealedBlobForCloudSync } from "./personal-vault.mjs";
|
|
14
|
+
import { CborTagValue, decodeAndVerifyPersonalArcblockJwt, decodeAndVerifyPersonalOcapTx, deriveOcapIdentitiesFromChildPoint, estimateOcapExecutionCostUpperBound, resolveRequiredOcapPolicyTier } from "./ocap-clear-signing.mjs";
|
|
15
|
+
import { decryptGuardianColdShareToSteelWords24, enforceSingleCustodianDecryptPerSession, generateGuardianKeypair, proveColdShardFromSteelWords24, sweepErc20Transfer, sweepEth } from "./offline-ceremony.mjs";
|
|
16
|
+
import { MAX_X402_ACCEPTS_ENTRIES, MAX_X402_CHALLENGE_BYTES, MAX_X402_RETRIES, X402_EXACT_EVM_TX_SCHEME, X402_PROTOCOL_VERSION, createX402AgentPaymentFetch, decodeX402PaymentHeader, encodeX402PaymentHeader, parseX402PaymentChallenge } from "./x402-agent-guard.mjs";
|
|
17
|
+
|
|
18
|
+
export { ACTOR_KIND_AND_ALG_BYTE, AppendOnlyDkgEchoLock, BIP39_ENGLISH_WORDLIST, BIP39_ENGLISH_WORD_TO_INDEX, BIP44_ETH_STANDARD_PATH, BLIND_SLOT_RECORD_BYTES, BSGS_M, CANONICAL_BIP39_ENGLISH_SHA256_HEX, CLOUD_SYNC_SEALED_BLOB_BYTES, CborTagValue, DEFAULT_COLD_GUARDIANS, DEFAULT_COLD_THRESHOLD, DEFAULT_ONLINE_PARTIES, DEFAULT_ONLINE_THRESHOLD, DST_BASEOT_KEY_V1, DST_BASEOT_S_POK_V1, DST_CANARY_CHALLENGE_V1, DST_CANARY_SHARD_POK_V1, DST_CHILD_TWEAK_V1, DST_COT_ROW_V1, DST_DKG_COM_V2, DST_DKG_CTX_V2, DST_DKG_ECHO_V2, DST_DKG_POK_V2, DST_DKG_SELFTEST_V2, DST_DKG_SHARE_AAD_V2, DST_DKG_STEP1_AUTH_V1, DST_DKG_TRANSCRIPT_V2, DST_DKG_X25519_HKDF_V2, DST_EMERGENCY_SWEEP_NONCE_V1, DST_KOS15_CHI_V1, DST_LHL_GADGET_V1, DST_MTA_ETA_V1, DST_OT_CTR_IV_V1, DST_PERSONAL_ANNOUNCE_TICKET_V1, DST_PERSONAL_BASEOT_CTX_V1, DST_PERSONAL_BLIND_OCAP_VELOCITY_TAG_V1, DST_PERSONAL_BLIND_SLOT_TAG_V1, DST_PERSONAL_BLIND_VAULT_TAG_V1, DST_PERSONAL_BLIND_VELOCITY_TAG_V1, DST_PERSONAL_BLOB_AAD_V1, DST_PERSONAL_BLOB_MAGIC, DST_PERSONAL_CHALLENGE_ANNOUNCE_V1, DST_PERSONAL_CHALLENGE_ENTITLEMENT_APPLY_V1, DST_PERSONAL_CHALLENGE_PAIR_RESPLIT_V1, DST_PERSONAL_CHALLENGE_PRESIGN_INIT_V1, DST_PERSONAL_CHALLENGE_RESEAL_KID_V1, DST_PERSONAL_CHALLENGE_REVOKE_SLOT_V1, DST_PERSONAL_CHALLENGE_SEAL_ENROLL_V1, DST_PERSONAL_CHALLENGE_SESSION_LOCK_V1, DST_PERSONAL_CHALLENGE_SESSION_OPEN_V1, DST_PERSONAL_CHALLENGE_SIGN_V1, DST_PERSONAL_CHALLENGE_VETO_V1, DST_PERSONAL_CLEAR_PREVIEW_V1, DST_PERSONAL_CLOUD_BLOB_V1, DST_PERSONAL_CLOUD_SYNC_V1, DST_PERSONAL_CLUSTER_HDKG_V1, DST_PERSONAL_COLD_MANIFEST_V1, DST_PERSONAL_DEVICE_AAD_V1, DST_PERSONAL_DEVICE_ENV_V1, DST_PERSONAL_ENTITLEMENT_TICKET_V1, DST_PERSONAL_FIREWALL_ATTESTATION_V1, DST_PERSONAL_GUARDIAN_QUORUM_V1, DST_PERSONAL_PAIR_POP_V1, DST_PERSONAL_PAIR_SHARE_AAD_V1, DST_PERSONAL_PAIR_SHARE_BOX_V1, DST_PERSONAL_POLICY_V1, DST_PERSONAL_PWD_CLIENT_HKDF_V1, DST_PERSONAL_PWD_HSM_HKDF_V1, DST_PERSONAL_ROLE_QUORUM_V1, DST_PERSONAL_SEAL_ENROLL_ACTOR_POK_V1, DST_PERSONAL_SEAL_KEY_V1, DST_PERSONAL_SEAL_SALT_V1, DST_PERSONAL_SIMULATED_DELTA_V1, DST_PERSONAL_TRANSPORT_AAD_V1, DST_PERSONAL_TRANSPORT_BOX_V1, DST_PRESIG_COM_V1, DST_PRESIG_ID_V1, DST_PRESIG_PI_LIN_K_V1, DST_PRESIG_PI_POK_Z_V1, DST_PRESIG_POK_B_V1, DST_PRESIG_POK_CK_V1, DST_PRESIG_POK_GAMMA_V1, DST_PRESIG_RERAND_V1, DST_PRESIG_ZETA_HKDF_V1, DST_PRESIG_ZETA_V1, DST_RULE_TWEAK_V1, DST_VES_BIT_OR_V1, DST_VES_CHUNK_LIN_V1, DirectBitElGamalVesPlugin, DkgParticipantSession, EIP1559_TX_TYPE_BYTE, ENTITLEMENT_TIER_CODE, ERC20_APPROVE_SELECTOR_HEX, ERC20_TRANSFER_SELECTOR_HEX, ESCAPE_DRILL_MAX_AGE_SECONDS, FORBIDDEN_ONLINE_ROLE_ESCAPE_CANARY, Fn, HARD_BANNED_PERSONAL_EVM_SELECTORS, HSM_SEALED_BLOB_BYTES, HSM_SEALED_BLOB_CIPHERTEXT_BYTES, HSM_SEALED_BLOB_CIPHERTEXT_OFFSET, HSM_SEALED_BLOB_HEADER_BYTES, HSM_SEALED_BLOB_HEADER_MAC_OFFSET, HSM_SEALED_BLOB_HEADER_WITH_MAC_BYTES, HSM_SEALED_BLOB_IV_OFFSET, HSM_SEALED_BLOB_MAX_POLICY_UTF8_BYTES, HSM_SEALED_BLOB_TAG_OFFSET, HSM_SEALED_BLOB_VERSION, H_scalar, MAX_ACTIVE_PRESIGN_SESSIONS, MAX_ANNOUNCE_VALIDITY_WINDOW_SEC, MAX_BLIND_RECORDS, MAX_MPC_CLUSTER_NODES, MAX_MPC_PEER_MESSAGE_BYTES, MAX_MPC_SIGN_REQUEST_BYTES, MAX_ON_DEMAND_SILENCE_SECONDS, MAX_PERSONAL_CALL_DEPTH, MAX_PERSONAL_FIREWALL_ATTESTATION_TTL_SECONDS, MAX_PERSONAL_HTTP_BODY_BYTES, MAX_PERSONAL_JSON_DEPTH, MAX_PERSONAL_JWT_TTL_SECONDS, MAX_PERSONAL_JWT_UNSIGNED_BYTES, MAX_PERSONAL_OCAP_CBOR_DEPTH, MAX_PERSONAL_OCAP_DELEGATE_TTL_SECONDS, MAX_PERSONAL_OCAP_TX_BYTES, MAX_PERSONAL_TX_DATA_BYTES, MAX_RECOVERY_PACKAGE_BYTES, MAX_RULE_DAG_NODES, MAX_RULE_YAML_BYTES, MAX_TRAVEL_SESSION_TTL_SECONDS, MAX_X402_ACCEPTS_ENTRIES, MAX_X402_CHALLENGE_BYTES, MAX_X402_RETRIES, MIN_ANNOUNCE_VALIDITY_WINDOW_SEC, MPC_PROTOCOL_VERSION, MpcProtocolError, OT_BASE_PARTIAL_BITS, OT_COLUMN_BYTES, OT_EXTENSION_ROWS, OT_GADGET_BITS, OT_KAPPA_BITS, OT_KAPPA_BYTES, OT_LHL_EXTRA_BITS, OT_SACRIFICE_BITS, PEDERSEN_H, PEDERSEN_H_COMP33, PEDERSEN_H_COMPRESSED_HEX, PEDERSEN_H_DST, PEDERSEN_H_MESSAGE, PERSONAL_MAX_VELOCITY_UINT128, PERSONAL_PRESIG_TTL_SECONDS, PersonalCosignerResponderSession, PresignPartySession, SECP256K1_G, SECP256K1_HALF_N, SECP256K1_N, SECP256K1_P, SECP256K1_ZERO, UNLIMITED_APPROVE_THRESHOLD, VES_BITS_PER_CHUNK, VES_BITS_PER_SHARE, VES_BIT_RECORD_BYTES, VES_CHUNKS_PER_SHARE, VES_GUARDIAN_BUNDLE_BYTES, VES_LINEAR_DLEQ_BYTES, VES_MAX_LIMB_VALUE, VES_MAX_SUMMED_LIMB, VolatilePresignaturePool, X402_EXACT_EVM_TX_SCHEME, X402_PROTOCOL_VERSION, actorKindAndAlgToByte, addModN, additiveToShamirSlot1Share, additiveToShamirSlot2Share, aes256EncryptBlock, aes256GcmDecryptDetached, aes256GcmEncryptDetached, aggregateOnlineSignature, aggregateRecoveryPackage, applyAdditiveTweak, applyHsmSlotResplitDelta, assembleCanaryActivationCert, assertAllowedOnlineRole, assertChallengeBundleMatchesManifest, assertNoEip7702Bytes, assertPersonalSlotNotExpired, assertSafeCeremonyId, assertScalarInField, assertScalarNonZero, assertValidX25519PublicKey, base64UrlDecodeBytes, base64UrlEncodeBytes, baseOtReceiverStep2, baseOtSenderStep1, baseOtSenderStep3, bigintToMinimalBytesBE, bootstrapPersonalVaultClient, buildPersonalAnnounceChallengeDigest32, buildPersonalClearSigningPreview, buildPersonalEntitlementApplyChallengeDigest32, buildPersonalPairResplitChallengeDigest32, buildPersonalPresignInitChallengeDigest32, buildPersonalResealKidChallengeDigest32, buildPersonalRevokeSlotChallengeDigest32, buildPersonalSealEnrollChallengeDigest32, buildPersonalSessionLockChallengeDigest32, buildPersonalSessionOpenChallengeDigest32, buildPersonalSignChallengeDigest32, buildPersonalVaultClusterInfo, buildPersonalVetoChallengeDigest32, byteToActorKindAndAlg, bytes16ToU128LE, bytes32ToScalarNonZero, bytes32ToScalarStrict, bytesToBigIntBE, bytesToHex, canonicalizePersonalBlobAadBytes, canonicalizePersonalVaultPolicy, completeActorSlotPairingOnTarget, computeCanaryChallengeDigest32, computeDkgContextHash32, computeDkgSubsetSelfTestDigest32, computeHsmSealedBlobHeaderMac32, computeNonDegenerateActorResplitShare, computePersonalActorChallengeDigest32, computePersonalClearSigningPreviewHash32, computePersonalPolicyHash32, computeRerandomizedNoncePoint, computeSimulatedDeltaCommitment32, computeSubsetBoundPresigId, computeVaultEntitlementTicketDigest32, computeX25519SharedSecret, concatBytes, constantTimeEqual, createActorSlotPairingBootstrap, createColdShardSchnorrPok, createLinearPedersenDleqProof, createNodeColdVesContribution, createOnlineSignShare, createPedersenPok, createPersonalMpcEoaSigner, createPersonalSealEnrollActorPok, createSchnorrPokInBase, createX402AgentPaymentFetch, decodeAndRecoverSignedEip1559Tx, decodeAndVerifyPersonalArcblockJwt, decodeAndVerifyPersonalEip1559Tx, decodeAndVerifyPersonalOcapTx, decodeBip39Words24ToColdShare, decodeErc20ApproveCalldata, decodeErc20TransferCalldata, decodeHsmSealedBlobHeader319, decodeHsmSealedBlobInnerPlaintext3717, decodePointCompressed, decodeX402PaymentHeader, decomposeScalarWithLhlGadget, decryptGuardianColdShareBsgs, decryptGuardianColdShareToSteelWords24, defaultRandomBytes, deriveBip44EthAddressFromWords24, deriveBlindOcapVelocityTag32, deriveBlindSlotTag32, deriveBlindVaultTag32, deriveBlindVelocityTag32, deriveDualPadFromCotRow, deriveGrothShoupRerandScalar, deriveHsmPersonalSealKey32, deriveOcapIdentitiesFromChildPoint, derivePersonalVaultChildKey, derivePersonalWakePasswordKeys, deriveRoleBoundChild, deriveRuleBoundChild, deriveUntweakedChild, ecrecoverEthAddress, eklundhTranspose128x1024, encodeColdShareToBip39Words24, encodeErc20ApproveCalldata, encodeErc20TransferCalldata, encodeHsmSealedBlobHeader319, encodeHsmSealedBlobInnerPlaintext3717, encodePointCompressed, encodeSignedEip1559Tx, encodeUnsignedEip1559Tx, encodeX402PaymentHeader, enforceSingleCustodianDecryptPerSession, enumerateCombinations, enumerateValid24thBip39Siblings, estimateOcapExecutionCostUpperBound, evaluateConsumedPresigShareWithRerand, evaluateFeldmanCommitments, evaluatePolynomialModN, expandColumnPrgAes256Ctr, expandKos15ChiWeights, exportPrintableManifestCard, gadgetMtaReceiverVerifyAndFinish, gadgetMtaSenderCreateMessage, generateGuardianKeypair, getGadgetVector768, gf128Mul, guardianIndexToPlateLabel, hashTranscriptSha256, hexToBytes, identifyColdShareIndexViaFeldman, initiateActorSlotResplit, invModN, isAgentActorKind, lagrangeCoefficientAtZero, lengthPrefixedEncode, modN, mulBaseG, mulModN, mulPoint, negModN, normalizeActorPublicKeyToPadded65, normalizeCanonicalOcapTokenKey, normalizeHexBytes, normalizeMaxTokenOutflowsCaps, normalizeOcapAddressOrEth, normalizeSortedSubset, openHsmInboundTransportBox, otExtendReceiverStep1, otExtendReceiverStep3, otExtendSenderStep2, otExtendSenderStep4VerifyBeforePads, parseHsmSealedBlobHeader, parseRecoveryPackageBytes, parseStrictEthAddress, parseX402PaymentChallenge, pedersenCommit, pointToEthAddress, promoteNodeRecordAfterSelfTests, proveColdShardFromSteelWords24, recombineGadgetBitsModN, recoverPersonalVaultRootOffline, resolveRequiredOcapPolicyTier, resolveRequiredPolicyTier, rlpDecode, rlpEncode, runPersonalClientPresignWithTransport, sampleScalarNonZero, scalarToBytes32, sealDeviceShareEnvelope, sealHsmInboundTransportBox, secp256k1, signAnnounceTicket, signCanaryChallengeApproval, signGuardianQuorumApproval, signPersonalActorChallenge, signPersonalFirewallAttestation, signPersonalVaultRecoverySweepOffline, signRoleQuorumApproval, signVaultEntitlementTicket, solveDiscreteLogBsgs, sortedSubsetBytes, subModN, subsetsEqual, sweepErc20Transfer, sweepEth, toEip55ChecksumAddress, u128ToBytes16LE, u16be, u32be, u64be, u8, unsealDeviceShareEnvelope, unwrapSealedBlobFromCloudSync, utf8Bytes, validateActorPublicKeyPadded65, validateAndComputeDkgContext, validatePrintableManifestCard, verifyActorSlotPairingBootstrap, verifyAndDeriveRequestChildKey, verifyCanaryActivationCert, verifyCanaryChallengeBundle, verifyColdShardSchnorrPok, verifyGuardianQuorumProof, verifyLinearPedersenDleqProof, verifyManifestAgainstDkgConfig, verifyManifestAgainstRecoveryPackage, verifyNodeColdVesContribution, verifyOnlineSignShare, verifyPedersenPok, verifyPersonalActorSignature, verifyPersonalAdditiveSplitMatchesRoot, verifyPersonalColdRecoveryKitManifest, verifyPersonalFirewallAttestation, verifyPersonalPolicyProofBundle, verifyPersonalSealEnrollActorPok, verifyPersonalSimulationBalanceDelta, verifyRecoveryPackage, verifyRoleQuorumProof, verifySchnorrPokInBase, verifySignedAnnounceTicket, verifyVaultEntitlementTicket, wipeBaseOtReceiverState, wipeBaseOtSenderState, wipeVerifiedCotReceiverRows, wipeVerifiedCotSenderRows, wrapSealedBlobForCloudSync, zeroizeBytes };
|
package/esm/mta.d.mts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { RandomBytesFn } from "./secp256k1-scalar.mjs";
|
|
2
|
+
import { VerifiedCotReceiverRows, VerifiedCotSenderRows } from "./ot.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/mta.d.ts
|
|
5
|
+
declare function getGadgetVector768(): ReadonlyArray<bigint>;
|
|
6
|
+
/**
|
|
7
|
+
* Encodes Receiver `B`'s secret scalar `\beta \in Z_n^*` into `768` choice bits `b_{0..767}`
|
|
8
|
+
* using `512` fresh CSPRNG Leftover-Hash-Lemma bits `b_{256..767}` and exact binary decomposition
|
|
9
|
+
* of `\beta_{rem} = (\beta - \sum_{l=256}^{767} b_l g_l) mod n` in `b_{0..255}`.
|
|
10
|
+
*/
|
|
11
|
+
declare function decomposeScalarWithLhlGadget(betaScalar: bigint, rng?: RandomBytesFn): Uint8Array;
|
|
12
|
+
declare function recombineGadgetBitsModN(choiceBits768: Uint8Array): bigint;
|
|
13
|
+
/**
|
|
14
|
+
* Single-row `SHAKE256(96B)` dual-pad extractor (`(r_{l,bit}, r_hat_{l,bit}) \in Z_n^2`).
|
|
15
|
+
* Squeezes an initial 96-byte chunk (3 x 32B candidates for 2 scalars) and continues squeezing
|
|
16
|
+
* 32B blocks on the same XOF stream if any 256-bit block is `>= n` (exact unbiased over `Z_n^2`).
|
|
17
|
+
*/
|
|
18
|
+
declare function deriveDualPadFromCotRow(ctxMta: Uint8Array, rowIndex: number, bit: 0 | 1, rowBytes16: Uint8Array): readonly [bigint, bigint];
|
|
19
|
+
interface GadgetMtaPayload {
|
|
20
|
+
readonly senderSlotA: number;
|
|
21
|
+
readonly receiverSlotB: number;
|
|
22
|
+
readonly cAlphaComp33: Uint8Array;
|
|
23
|
+
readonly cHatAlphaComp33: Uint8Array;
|
|
24
|
+
readonly uPackedBytes: Uint8Array;
|
|
25
|
+
readonly uHatPackedBytes: Uint8Array;
|
|
26
|
+
readonly alphaStarBytes32: Uint8Array;
|
|
27
|
+
readonly rhoStarBytes32: Uint8Array;
|
|
28
|
+
readonly rStarPackedBytes: Uint8Array;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Sender `A` (slot `i`) executes single-row dual-pad `GadgetMtA` over verified `KOS15` rows,
|
|
32
|
+
* anchored to Round-1 Pedersen commitment `C_{k,i} = k_i G + \rho_{k,i} H`.
|
|
33
|
+
* Returns additive share `u_A \in Z_n` such that `u_A + v_B === k_i * \beta_j (mod n)`.
|
|
34
|
+
*/
|
|
35
|
+
declare function gadgetMtaSenderCreateMessage(params: {
|
|
36
|
+
ctxMta: Uint8Array;
|
|
37
|
+
senderSlotA: number;
|
|
38
|
+
receiverSlotB: number;
|
|
39
|
+
verifiedSenderRows: VerifiedCotSenderRows;
|
|
40
|
+
alphaScalar: bigint;
|
|
41
|
+
rhoAlphaScalar: bigint;
|
|
42
|
+
expectedRound1CommitmentCk: Uint8Array;
|
|
43
|
+
rng?: RandomBytesFn;
|
|
44
|
+
}): {
|
|
45
|
+
senderShareModN: bigint;
|
|
46
|
+
payload: GadgetMtaPayload;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Receiver `B` (slot `j`) verifies `C_alpha === C_{k,i}` (Round-1 commitment binding),
|
|
50
|
+
* checks the Pedersen linear combination `\alpha^* G + \rho^* H == \eta C_{k,i} + \hat{C}_\alpha`,
|
|
51
|
+
* verifies all 768 single-row dual-pad equations `\eta t_l + \hat{t}_l == r^*_l + b_l \alpha^* (mod n)`,
|
|
52
|
+
* and outputs additive share `v_B \in Z_n`.
|
|
53
|
+
*/
|
|
54
|
+
declare function gadgetMtaReceiverVerifyAndFinish(params: {
|
|
55
|
+
ctxMta: Uint8Array;
|
|
56
|
+
senderSlotA: number;
|
|
57
|
+
receiverSlotB: number;
|
|
58
|
+
verifiedReceiverRows: VerifiedCotReceiverRows;
|
|
59
|
+
expectedRound1CommitmentCk: Uint8Array;
|
|
60
|
+
payload: GadgetMtaPayload;
|
|
61
|
+
}): bigint;
|
|
62
|
+
//#endregion
|
|
63
|
+
export { GadgetMtaPayload, decomposeScalarWithLhlGadget, deriveDualPadFromCotRow, gadgetMtaReceiverVerifyAndFinish, gadgetMtaSenderCreateMessage, getGadgetVector768, recombineGadgetBitsModN };
|
package/esm/mta.mjs
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { DST_COT_ROW_V1, DST_LHL_GADGET_V1, DST_MTA_ETA_V1, MpcProtocolError, OT_BASE_PARTIAL_BITS, OT_GADGET_BITS, OT_LHL_EXTRA_BITS, SECP256K1_N } from "./constants.mjs";
|
|
2
|
+
import { H_scalar, addModN, assertScalarNonZero, bytes32ToScalarStrict, bytesToBigIntBE, constantTimeEqual, decodePointCompressed, defaultRandomBytes, encodePointCompressed, mulModN, mulPoint, negModN, pedersenCommit, sampleScalarNonZero, scalarToBytes32, subModN, u32be, zeroizeBytes } from "./secp256k1-scalar.mjs";
|
|
3
|
+
import { shake256 } from "@noble/hashes/sha3.js";
|
|
4
|
+
|
|
5
|
+
//#region src/mta.ts
|
|
6
|
+
/**
|
|
7
|
+
* Single-Row Dual-Pad `GadgetMtA` anchored to Presignature Round-1 `C_{k,i}` (`design.md` §4.4(3)):
|
|
8
|
+
*
|
|
9
|
+
* - Gadget vector `g_{0..767}`:
|
|
10
|
+
* - `g_l = 2^l mod n` for `0 <= l < 256`
|
|
11
|
+
* - `g_l = H_scalar("ARC-MPC-LHL-GADGET-V1", u32be(l))` for `256 <= l < 768`
|
|
12
|
+
* - Both pads `(r_{l,b}, r_hat_{l,b}) \in Z_n^2` derive from ONE single COT row
|
|
13
|
+
* `row_{l,b} = Q_l ^ (b * Delta)` via `SHAKE256("ARC-MPC-COT-ROW-V1", ctx_mta, u32be(l), u8(b), row)`
|
|
14
|
+
* squeezing a 96-byte fast-path buffer (with XOF continuation on `>= n`) for exact zero modulo bias.
|
|
15
|
+
* - Anchored to `C_alpha === C_{k,i}`: Receiver `B` strictly verifies byte-equality with Round-1
|
|
16
|
+
* `C_{k,i}`, checks `\alpha^* G + \rho^* H == \eta C_{k,i} + \hat{C}_\alpha`, and verifies all
|
|
17
|
+
* 768 linear checks `\eta t_l + \hat{t}_l === r^*_l + b_l \alpha^* (mod n)`.
|
|
18
|
+
* Note: Single-row selective-failure probing on `s` rows passes with probability `2^{-s}` while
|
|
19
|
+
* `\tilde{x}_B` never enters `GadgetMtA`, `b_B` / `\gamma_B` are single-use and wiped before `e_B`
|
|
20
|
+
* on any Round-2 abort, and `512` fresh per-peer CSPRNG LHL bits keep `b_B mod n` statistically
|
|
21
|
+
* uniform (`> 128`-bit LHL security margin).
|
|
22
|
+
*/
|
|
23
|
+
let cachedGadgetVector = null;
|
|
24
|
+
function getGadgetVector768() {
|
|
25
|
+
if (cachedGadgetVector !== null) return cachedGadgetVector;
|
|
26
|
+
const vec = new Array(OT_GADGET_BITS);
|
|
27
|
+
let pow2 = 1n;
|
|
28
|
+
for (let l = 0; l < OT_BASE_PARTIAL_BITS; l++) {
|
|
29
|
+
vec[l] = pow2;
|
|
30
|
+
pow2 = mulModN(pow2, 2n);
|
|
31
|
+
}
|
|
32
|
+
for (let l = OT_BASE_PARTIAL_BITS; l < OT_GADGET_BITS; l++) vec[l] = H_scalar(DST_LHL_GADGET_V1, u32be(l));
|
|
33
|
+
cachedGadgetVector = vec;
|
|
34
|
+
return vec;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Encodes Receiver `B`'s secret scalar `\beta \in Z_n^*` into `768` choice bits `b_{0..767}`
|
|
38
|
+
* using `512` fresh CSPRNG Leftover-Hash-Lemma bits `b_{256..767}` and exact binary decomposition
|
|
39
|
+
* of `\beta_{rem} = (\beta - \sum_{l=256}^{767} b_l g_l) mod n` in `b_{0..255}`.
|
|
40
|
+
*/
|
|
41
|
+
function decomposeScalarWithLhlGadget(betaScalar, rng = defaultRandomBytes) {
|
|
42
|
+
assertScalarNonZero(betaScalar, "MtA receiver betaScalar");
|
|
43
|
+
const gadget = getGadgetVector768();
|
|
44
|
+
const choiceBits768 = new Uint8Array(OT_GADGET_BITS);
|
|
45
|
+
const randomLhlBytes64 = rng(OT_LHL_EXTRA_BITS >>> 3);
|
|
46
|
+
if (randomLhlBytes64.length !== 64) {
|
|
47
|
+
zeroizeBytes(randomLhlBytes64);
|
|
48
|
+
throw new MpcProtocolError("INVALID_PARAMETER", "RNG must produce 64 bytes for LHL bits");
|
|
49
|
+
}
|
|
50
|
+
let highSum = 0n;
|
|
51
|
+
try {
|
|
52
|
+
for (let i = 0; i < OT_LHL_EXTRA_BITS; i++) {
|
|
53
|
+
const bit = randomLhlBytes64[i >>> 3] >>> (i & 7) & 1;
|
|
54
|
+
const idx = OT_BASE_PARTIAL_BITS + i;
|
|
55
|
+
choiceBits768[idx] = bit;
|
|
56
|
+
if (bit === 1) highSum = addModN(highSum, gadget[idx]);
|
|
57
|
+
}
|
|
58
|
+
} finally {
|
|
59
|
+
zeroizeBytes(randomLhlBytes64);
|
|
60
|
+
}
|
|
61
|
+
const betaRem = subModN(betaScalar, highSum);
|
|
62
|
+
for (let l = 0; l < OT_BASE_PARTIAL_BITS; l++) choiceBits768[l] = Number(betaRem >> BigInt(l) & 1n);
|
|
63
|
+
return choiceBits768;
|
|
64
|
+
}
|
|
65
|
+
function recombineGadgetBitsModN(choiceBits768) {
|
|
66
|
+
if (choiceBits768.length !== OT_GADGET_BITS) throw new MpcProtocolError("INVALID_PARAMETER", `Expected ${OT_GADGET_BITS} gadget bits`);
|
|
67
|
+
const gadget = getGadgetVector768();
|
|
68
|
+
let acc = 0n;
|
|
69
|
+
for (let l = 0; l < OT_GADGET_BITS; l++) {
|
|
70
|
+
const bit = choiceBits768[l];
|
|
71
|
+
if (bit !== 0 && bit !== 1) throw new MpcProtocolError("INVALID_PARAMETER", `Invalid gadget bit at ${l}`);
|
|
72
|
+
if (bit === 1) acc = addModN(acc, gadget[l]);
|
|
73
|
+
}
|
|
74
|
+
return acc;
|
|
75
|
+
}
|
|
76
|
+
const COT_ROW_TAG_BYTES = new TextEncoder().encode(DST_COT_ROW_V1);
|
|
77
|
+
function buildCotRowHasherTemplate(ctxMta) {
|
|
78
|
+
const prefixLen = 4 + COT_ROW_TAG_BYTES.length + 4 + 4 + ctxMta.length;
|
|
79
|
+
const prefix = new Uint8Array(prefixLen);
|
|
80
|
+
const pView = new DataView(prefix.buffer);
|
|
81
|
+
let off = 0;
|
|
82
|
+
pView.setUint32(off, COT_ROW_TAG_BYTES.length, false);
|
|
83
|
+
off += 4;
|
|
84
|
+
prefix.set(COT_ROW_TAG_BYTES, off);
|
|
85
|
+
off += COT_ROW_TAG_BYTES.length;
|
|
86
|
+
pView.setUint32(off, 4, false);
|
|
87
|
+
off += 4;
|
|
88
|
+
pView.setUint32(off, ctxMta.length, false);
|
|
89
|
+
off += 4;
|
|
90
|
+
prefix.set(ctxMta, off);
|
|
91
|
+
const baseHasher = shake256.create({});
|
|
92
|
+
baseHasher.update(prefix);
|
|
93
|
+
const suffix = new Uint8Array(33);
|
|
94
|
+
const sView = new DataView(suffix.buffer);
|
|
95
|
+
sView.setUint32(0, 4, false);
|
|
96
|
+
sView.setUint32(8, 1, false);
|
|
97
|
+
sView.setUint32(13, 16, false);
|
|
98
|
+
const initial96 = new Uint8Array(96);
|
|
99
|
+
const extra32 = new Uint8Array(32);
|
|
100
|
+
return {
|
|
101
|
+
derive(rowIndex, bit, rowBytes16) {
|
|
102
|
+
if (rowBytes16.length !== 16) throw new MpcProtocolError("INVALID_PARAMETER", "COT row must be 16 bytes");
|
|
103
|
+
sView.setUint32(4, rowIndex >>> 0, false);
|
|
104
|
+
suffix[12] = bit;
|
|
105
|
+
suffix.set(rowBytes16, 17);
|
|
106
|
+
const xof = baseHasher.clone();
|
|
107
|
+
try {
|
|
108
|
+
xof.update(suffix);
|
|
109
|
+
xof.xofInto(initial96);
|
|
110
|
+
let rPrimary = null;
|
|
111
|
+
let rHat = null;
|
|
112
|
+
for (let chunk = 0; chunk < 3 && rHat === null; chunk++) {
|
|
113
|
+
const candidate = bytesToBigIntBE(initial96.subarray(chunk * 32, (chunk + 1) * 32));
|
|
114
|
+
if (candidate < SECP256K1_N) if (rPrimary === null) rPrimary = candidate;
|
|
115
|
+
else rHat = candidate;
|
|
116
|
+
}
|
|
117
|
+
while (rHat === null) {
|
|
118
|
+
xof.xofInto(extra32);
|
|
119
|
+
const candidate = bytesToBigIntBE(extra32);
|
|
120
|
+
if (candidate < SECP256K1_N) if (rPrimary === null) rPrimary = candidate;
|
|
121
|
+
else rHat = candidate;
|
|
122
|
+
}
|
|
123
|
+
return [rPrimary, rHat];
|
|
124
|
+
} finally {
|
|
125
|
+
xof.destroy();
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
destroy() {
|
|
129
|
+
zeroizeBytes(suffix, initial96, extra32);
|
|
130
|
+
baseHasher.destroy();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Single-row `SHAKE256(96B)` dual-pad extractor (`(r_{l,bit}, r_hat_{l,bit}) \in Z_n^2`).
|
|
136
|
+
* Squeezes an initial 96-byte chunk (3 x 32B candidates for 2 scalars) and continues squeezing
|
|
137
|
+
* 32B blocks on the same XOF stream if any 256-bit block is `>= n` (exact unbiased over `Z_n^2`).
|
|
138
|
+
*/
|
|
139
|
+
function deriveDualPadFromCotRow(ctxMta, rowIndex, bit, rowBytes16) {
|
|
140
|
+
const tpl = buildCotRowHasherTemplate(ctxMta);
|
|
141
|
+
try {
|
|
142
|
+
return tpl.derive(rowIndex, bit, rowBytes16);
|
|
143
|
+
} finally {
|
|
144
|
+
tpl.destroy();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function computeMtaEtaChallenge(ctxMta, senderSlotA, receiverSlotB, cAlphaComp33, cHatAlphaComp33, uPackedBytes, uHatPackedBytes) {
|
|
148
|
+
return H_scalar(DST_MTA_ETA_V1, ctxMta, u32be(senderSlotA), u32be(receiverSlotB), cAlphaComp33, cHatAlphaComp33, uPackedBytes, uHatPackedBytes);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Sender `A` (slot `i`) executes single-row dual-pad `GadgetMtA` over verified `KOS15` rows,
|
|
152
|
+
* anchored to Round-1 Pedersen commitment `C_{k,i} = k_i G + \rho_{k,i} H`.
|
|
153
|
+
* Returns additive share `u_A \in Z_n` such that `u_A + v_B === k_i * \beta_j (mod n)`.
|
|
154
|
+
*/
|
|
155
|
+
function gadgetMtaSenderCreateMessage(params) {
|
|
156
|
+
const { ctxMta, senderSlotA, receiverSlotB, verifiedSenderRows, alphaScalar, rhoAlphaScalar, expectedRound1CommitmentCk, rng = defaultRandomBytes } = params;
|
|
157
|
+
assertScalarNonZero(alphaScalar, "MtA alphaScalar");
|
|
158
|
+
assertScalarNonZero(rhoAlphaScalar, "MtA rhoAlphaScalar");
|
|
159
|
+
if (verifiedSenderRows.qRows768.length !== OT_GADGET_BITS) throw new MpcProtocolError("INVALID_PARAMETER", "Verified COT sender rows must have 768 rows");
|
|
160
|
+
const cAlphaComp33 = encodePointCompressed(pedersenCommit(alphaScalar, rhoAlphaScalar));
|
|
161
|
+
if (!constantTimeEqual(cAlphaComp33, expectedRound1CommitmentCk)) throw new MpcProtocolError("MTA_COMMITMENT_MISMATCH", "Sender C_alpha does not match Round-1 C_{k,i}");
|
|
162
|
+
const alphaHat = sampleScalarNonZero(rng);
|
|
163
|
+
const rhoHat = sampleScalarNonZero(rng);
|
|
164
|
+
const cHatAlphaComp33 = encodePointCompressed(pedersenCommit(alphaHat, rhoHat));
|
|
165
|
+
const r0Vec = new Array(OT_GADGET_BITS);
|
|
166
|
+
const rHat0Vec = new Array(OT_GADGET_BITS);
|
|
167
|
+
const uPackedBytes = new Uint8Array(OT_GADGET_BITS * 32);
|
|
168
|
+
const uHatPackedBytes = new Uint8Array(OT_GADGET_BITS * 32);
|
|
169
|
+
const row1Buf = new Uint8Array(16);
|
|
170
|
+
const rowHasher = buildCotRowHasherTemplate(ctxMta);
|
|
171
|
+
try {
|
|
172
|
+
for (let l = 0; l < OT_GADGET_BITS; l++) {
|
|
173
|
+
const row0 = verifiedSenderRows.qRows768[l];
|
|
174
|
+
for (let bIdx = 0; bIdx < 16; bIdx++) row1Buf[bIdx] = row0[bIdx] ^ verifiedSenderRows.deltaBytes16[bIdx];
|
|
175
|
+
const [r0, rHat0] = rowHasher.derive(l, 0, row0);
|
|
176
|
+
const [r1, rHat1] = rowHasher.derive(l, 1, row1Buf);
|
|
177
|
+
r0Vec[l] = r0;
|
|
178
|
+
rHat0Vec[l] = rHat0;
|
|
179
|
+
const uL = addModN(subModN(r0, r1), alphaScalar);
|
|
180
|
+
const uHatL = addModN(subModN(rHat0, rHat1), alphaHat);
|
|
181
|
+
uPackedBytes.set(scalarToBytes32(uL), l * 32);
|
|
182
|
+
uHatPackedBytes.set(scalarToBytes32(uHatL), l * 32);
|
|
183
|
+
}
|
|
184
|
+
} finally {
|
|
185
|
+
zeroizeBytes(row1Buf);
|
|
186
|
+
rowHasher.destroy();
|
|
187
|
+
}
|
|
188
|
+
const eta = computeMtaEtaChallenge(ctxMta, senderSlotA, receiverSlotB, cAlphaComp33, cHatAlphaComp33, uPackedBytes, uHatPackedBytes);
|
|
189
|
+
const alphaStar = addModN(mulModN(eta, alphaScalar), alphaHat);
|
|
190
|
+
const rhoStar = addModN(mulModN(eta, rhoAlphaScalar), rhoHat);
|
|
191
|
+
const rStarPackedBytes = new Uint8Array(OT_GADGET_BITS * 32);
|
|
192
|
+
const gadget = getGadgetVector768();
|
|
193
|
+
let sumGR0 = 0n;
|
|
194
|
+
for (let l = 0; l < OT_GADGET_BITS; l++) {
|
|
195
|
+
const r0 = r0Vec[l];
|
|
196
|
+
const rHat0 = rHat0Vec[l];
|
|
197
|
+
const rStarL = addModN(mulModN(eta, r0), rHat0);
|
|
198
|
+
rStarPackedBytes.set(scalarToBytes32(rStarL), l * 32);
|
|
199
|
+
sumGR0 = addModN(sumGR0, mulModN(gadget[l], r0));
|
|
200
|
+
r0Vec[l] = 0n;
|
|
201
|
+
rHat0Vec[l] = 0n;
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
senderShareModN: negModN(sumGR0),
|
|
205
|
+
payload: {
|
|
206
|
+
senderSlotA,
|
|
207
|
+
receiverSlotB,
|
|
208
|
+
cAlphaComp33,
|
|
209
|
+
cHatAlphaComp33,
|
|
210
|
+
uPackedBytes,
|
|
211
|
+
uHatPackedBytes,
|
|
212
|
+
alphaStarBytes32: scalarToBytes32(alphaStar),
|
|
213
|
+
rhoStarBytes32: scalarToBytes32(rhoStar),
|
|
214
|
+
rStarPackedBytes
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Receiver `B` (slot `j`) verifies `C_alpha === C_{k,i}` (Round-1 commitment binding),
|
|
220
|
+
* checks the Pedersen linear combination `\alpha^* G + \rho^* H == \eta C_{k,i} + \hat{C}_\alpha`,
|
|
221
|
+
* verifies all 768 single-row dual-pad equations `\eta t_l + \hat{t}_l == r^*_l + b_l \alpha^* (mod n)`,
|
|
222
|
+
* and outputs additive share `v_B \in Z_n`.
|
|
223
|
+
*/
|
|
224
|
+
function gadgetMtaReceiverVerifyAndFinish(params) {
|
|
225
|
+
const { ctxMta, senderSlotA, receiverSlotB, verifiedReceiverRows, expectedRound1CommitmentCk, payload } = params;
|
|
226
|
+
if (payload.senderSlotA !== senderSlotA || payload.receiverSlotB !== receiverSlotB) throw new MpcProtocolError("MTA_CONSISTENCY_CHECK_FAILED", "MtA payload slot header mismatch", senderSlotA);
|
|
227
|
+
if (!constantTimeEqual(payload.cAlphaComp33, expectedRound1CommitmentCk)) throw new MpcProtocolError("MTA_COMMITMENT_MISMATCH", `MtA C_alpha mismatch against Round-1 C_{k,${senderSlotA}}`, senderSlotA);
|
|
228
|
+
const expectedPackedLen = OT_GADGET_BITS * 32;
|
|
229
|
+
if (payload.uPackedBytes.length !== expectedPackedLen || payload.uHatPackedBytes.length !== expectedPackedLen || payload.rStarPackedBytes.length !== expectedPackedLen) throw new MpcProtocolError("MTA_CONSISTENCY_CHECK_FAILED", "Invalid MtA vector byte length", senderSlotA);
|
|
230
|
+
let cKiPoint;
|
|
231
|
+
let cHatPoint;
|
|
232
|
+
let alphaStar;
|
|
233
|
+
let rhoStar;
|
|
234
|
+
try {
|
|
235
|
+
cKiPoint = decodePointCompressed(expectedRound1CommitmentCk, false);
|
|
236
|
+
cHatPoint = decodePointCompressed(payload.cHatAlphaComp33, false);
|
|
237
|
+
alphaStar = bytes32ToScalarStrict(payload.alphaStarBytes32);
|
|
238
|
+
rhoStar = bytes32ToScalarStrict(payload.rhoStarBytes32);
|
|
239
|
+
} catch (err) {
|
|
240
|
+
throw new MpcProtocolError("MTA_CONSISTENCY_CHECK_FAILED", `Invalid MtA point/scalar from slot ${senderSlotA}: ${err.message}`, senderSlotA);
|
|
241
|
+
}
|
|
242
|
+
const eta = computeMtaEtaChallenge(ctxMta, senderSlotA, receiverSlotB, payload.cAlphaComp33, payload.cHatAlphaComp33, payload.uPackedBytes, payload.uHatPackedBytes);
|
|
243
|
+
const lhsPedersen = pedersenCommit(alphaStar, rhoStar);
|
|
244
|
+
const rhsPedersen = mulPoint(cKiPoint, eta).add(cHatPoint);
|
|
245
|
+
if (!lhsPedersen.equals(rhsPedersen)) throw new MpcProtocolError("MTA_CONSISTENCY_CHECK_FAILED", `MtA Pedersen linear check failed against sender slot ${senderSlotA}`, senderSlotA);
|
|
246
|
+
const gadget = getGadgetVector768();
|
|
247
|
+
let receiverShareAcc = 0n;
|
|
248
|
+
const rowHasher = buildCotRowHasherTemplate(ctxMta);
|
|
249
|
+
try {
|
|
250
|
+
for (let l = 0; l < OT_GADGET_BITS; l++) {
|
|
251
|
+
const bBit = verifiedReceiverRows.gadgetChoiceBits768[l];
|
|
252
|
+
let uL;
|
|
253
|
+
let uHatL;
|
|
254
|
+
let rStarL;
|
|
255
|
+
try {
|
|
256
|
+
uL = bytes32ToScalarStrict(payload.uPackedBytes.subarray(l * 32, (l + 1) * 32));
|
|
257
|
+
uHatL = bytes32ToScalarStrict(payload.uHatPackedBytes.subarray(l * 32, (l + 1) * 32));
|
|
258
|
+
rStarL = bytes32ToScalarStrict(payload.rStarPackedBytes.subarray(l * 32, (l + 1) * 32));
|
|
259
|
+
} catch {
|
|
260
|
+
throw new MpcProtocolError("MTA_CONSISTENCY_CHECK_FAILED", `Out-of-range scalar in MtA row ${l} from sender slot ${senderSlotA}`, senderSlotA);
|
|
261
|
+
}
|
|
262
|
+
const [rLb, rHatLb] = rowHasher.derive(l, bBit, verifiedReceiverRows.tRows768[l]);
|
|
263
|
+
const tL = bBit === 1 ? addModN(rLb, uL) : rLb;
|
|
264
|
+
const tHatL = bBit === 1 ? addModN(rHatLb, uHatL) : rHatLb;
|
|
265
|
+
if (addModN(mulModN(eta, tL), tHatL) !== (bBit === 1 ? addModN(rStarL, alphaStar) : rStarL)) throw new MpcProtocolError("MTA_CONSISTENCY_CHECK_FAILED", `MtA row ${l} consistency check failed against sender slot ${senderSlotA}`, senderSlotA);
|
|
266
|
+
receiverShareAcc = addModN(receiverShareAcc, mulModN(gadget[l], tL));
|
|
267
|
+
}
|
|
268
|
+
} finally {
|
|
269
|
+
rowHasher.destroy();
|
|
270
|
+
}
|
|
271
|
+
return receiverShareAcc;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
//#endregion
|
|
275
|
+
export { decomposeScalarWithLhlGadget, deriveDualPadFromCotRow, gadgetMtaReceiverVerifyAndFinish, gadgetMtaSenderCreateMessage, getGadgetVector768, recombineGadgetBitsModN };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { CanonicalPersonalOcapChainGasConfig, CanonicalPersonalVaultPolicy, PersonalClearSigningPreview, PersonalOcapChainGasConfig, PersonalPolicyTier, PersonalVaultPolicy } from "./personal-vault.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/ocap-clear-signing.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Derives the canonical OCAP `SECP256K1` (`ROLE_ACCOUNT = 0`, `KeyType.SECP256K1 = 1`, `HashType.SHA3 = 1`, `BASE58`)
|
|
7
|
+
* bare address (`z...`) and uncompressed 65-byte (`0x04 || X || Y`) + Ethereum 64-byte (`X || Y`) public keys
|
|
8
|
+
* from a compressed 33-byte secp256k1 child public key.
|
|
9
|
+
*/
|
|
10
|
+
declare function deriveOcapIdentitiesFromChildPoint(childPublicKeyComp33: Uint8Array | string): {
|
|
11
|
+
readonly ethChecksumAddress: string;
|
|
12
|
+
readonly ethUncompressedPk64: Uint8Array;
|
|
13
|
+
readonly ethUncompressedPkHex: string;
|
|
14
|
+
readonly ocapSecp256k1Address: string;
|
|
15
|
+
readonly ocapSecp256k1Did: string;
|
|
16
|
+
readonly secp256k1UncompressedPk65: Uint8Array;
|
|
17
|
+
readonly secp256k1UncompressedPkHex: string;
|
|
18
|
+
};
|
|
19
|
+
declare class CborTagValue {
|
|
20
|
+
readonly tag: number;
|
|
21
|
+
readonly value: unknown;
|
|
22
|
+
constructor(tag: number, value: unknown);
|
|
23
|
+
}
|
|
24
|
+
interface VerifiedPersonalOcapTx {
|
|
25
|
+
readonly unsignedPayloadBytes: Uint8Array;
|
|
26
|
+
readonly signingDigest32: Uint8Array;
|
|
27
|
+
readonly signingDigestHex: string;
|
|
28
|
+
readonly signerAddress: string;
|
|
29
|
+
readonly signerScheme: 'ethereum' | 'secp256k1';
|
|
30
|
+
readonly fromAddress: string;
|
|
31
|
+
readonly delegatorAddress?: string;
|
|
32
|
+
readonly toAddress: string;
|
|
33
|
+
readonly chainId: string;
|
|
34
|
+
readonly nonce: bigint;
|
|
35
|
+
readonly itxTypeUrl: string;
|
|
36
|
+
/** Effective bounded execution gas + protocol txFee (>= declared `Transaction.gas` field 5). */
|
|
37
|
+
readonly gasFee: bigint;
|
|
38
|
+
/** Raw `Transaction.gas` field 5 declared in unsigned CBOR (`0n` when omitted). */
|
|
39
|
+
readonly declaredGasField: bigint;
|
|
40
|
+
readonly serviceFee: bigint;
|
|
41
|
+
readonly nativeValueOutflow: bigint;
|
|
42
|
+
readonly totalNativeOutflow: bigint;
|
|
43
|
+
readonly tokenOutflows: ReadonlyArray<{
|
|
44
|
+
readonly tokenAddress: string;
|
|
45
|
+
readonly amount: bigint;
|
|
46
|
+
}>;
|
|
47
|
+
readonly outgoingAssetIds: ReadonlyArray<string>;
|
|
48
|
+
readonly nativeInflowExpected: bigint;
|
|
49
|
+
readonly tokenInflowsExpected: ReadonlyArray<{
|
|
50
|
+
readonly tokenAddress: string;
|
|
51
|
+
readonly amount: bigint;
|
|
52
|
+
}>;
|
|
53
|
+
readonly incomingAssetIds: ReadonlyArray<string>;
|
|
54
|
+
readonly expiredAtIso?: string;
|
|
55
|
+
readonly delegatedOps: ReadonlyArray<string>;
|
|
56
|
+
readonly isTransferLike: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Computes a deterministic, fail-closed upper bound on the OCAP execution gas + protocol `txFee`
|
|
60
|
+
* charged by `CreateGasEnsureFn` (`ensure-gas.ts`) and `EnsureTxCost` (`ensure-cost.ts`), even when
|
|
61
|
+
* `Transaction.gas` (field 5) is absent or `0` and the sender lacks a valid gas stake.
|
|
62
|
+
*/
|
|
63
|
+
declare function estimateOcapExecutionCostUpperBound(params: {
|
|
64
|
+
readonly unsignedPayloadByteLength: number;
|
|
65
|
+
readonly itxTypeUrl: string;
|
|
66
|
+
readonly outgoingAssetCount: number;
|
|
67
|
+
readonly incomingAssetCount: number;
|
|
68
|
+
readonly gasConfig: PersonalOcapChainGasConfig | CanonicalPersonalOcapChainGasConfig;
|
|
69
|
+
}): {
|
|
70
|
+
readonly estimatedExecutionGas: bigint;
|
|
71
|
+
readonly protocolTxFee: bigint;
|
|
72
|
+
readonly totalExecutionCostUpperBound: bigint;
|
|
73
|
+
};
|
|
74
|
+
declare function decodeAndVerifyPersonalOcapTx(params: {
|
|
75
|
+
readonly rawTxBytes: Uint8Array | string;
|
|
76
|
+
readonly childPublicKeyComp33: Uint8Array | string;
|
|
77
|
+
readonly policy?: PersonalVaultPolicy | CanonicalPersonalVaultPolicy;
|
|
78
|
+
readonly ocapGasConfig?: PersonalOcapChainGasConfig | CanonicalPersonalOcapChainGasConfig;
|
|
79
|
+
readonly requireExecutionGasBound?: boolean;
|
|
80
|
+
readonly ocapPrimaryTokenAddress?: string;
|
|
81
|
+
readonly nowSec?: bigint;
|
|
82
|
+
readonly hasL2OrL3QuorumProof?: boolean;
|
|
83
|
+
readonly hasL3GuardianQuorumProof?: boolean;
|
|
84
|
+
}): {
|
|
85
|
+
readonly verifiedOcapTx: VerifiedPersonalOcapTx;
|
|
86
|
+
readonly clearSigningPreview: PersonalClearSigningPreview;
|
|
87
|
+
readonly clearSigningPreviewHash32: Uint8Array;
|
|
88
|
+
/** Policy-independent preview hash computed solely from unsigned CBOR fields (`declaredGasField`), used by policy-blind Follower `SignedFirewallAttestation`. */
|
|
89
|
+
readonly intrinsicClearSigningPreviewHash32: Uint8Array;
|
|
90
|
+
};
|
|
91
|
+
declare function resolveRequiredOcapPolicyTier(params: {
|
|
92
|
+
readonly policy: PersonalVaultPolicy | CanonicalPersonalVaultPolicy;
|
|
93
|
+
readonly verifiedOcapTx: VerifiedPersonalOcapTx;
|
|
94
|
+
readonly currentRollingByAsset?: ReadonlyMap<string, bigint>;
|
|
95
|
+
readonly hasL2OrL3QuorumForOverflow?: boolean;
|
|
96
|
+
readonly attestedSimulatedNativeDeltaWei?: bigint;
|
|
97
|
+
}): {
|
|
98
|
+
readonly requiredTier: PersonalPolicyTier;
|
|
99
|
+
readonly projectedRollingByAsset: ReadonlyMap<string, bigint>;
|
|
100
|
+
};
|
|
101
|
+
interface VerifiedPersonalArcblockJwt {
|
|
102
|
+
readonly unsignedToken: string;
|
|
103
|
+
readonly unsignedPayloadBytes: Uint8Array;
|
|
104
|
+
readonly signingDigest32: Uint8Array;
|
|
105
|
+
readonly signingDigestHex: string;
|
|
106
|
+
readonly isDelegationToken: boolean;
|
|
107
|
+
readonly requiredTier: PersonalPolicyTier;
|
|
108
|
+
readonly issuerDid: string;
|
|
109
|
+
readonly subject: string;
|
|
110
|
+
readonly iatSec: bigint;
|
|
111
|
+
readonly expSec: bigint;
|
|
112
|
+
}
|
|
113
|
+
declare function decodeAndVerifyPersonalArcblockJwt(params: {
|
|
114
|
+
readonly unsignedTokenOrBytes: Uint8Array | string;
|
|
115
|
+
readonly childPublicKeyComp33: Uint8Array | string;
|
|
116
|
+
readonly nowSec: bigint;
|
|
117
|
+
readonly policy?: PersonalVaultPolicy | CanonicalPersonalVaultPolicy;
|
|
118
|
+
readonly hasL2OrL3QuorumProof?: boolean;
|
|
119
|
+
}): {
|
|
120
|
+
readonly verifiedJwt: VerifiedPersonalArcblockJwt;
|
|
121
|
+
readonly clearSigningPreview: PersonalClearSigningPreview;
|
|
122
|
+
readonly clearSigningPreviewHash32: Uint8Array;
|
|
123
|
+
};
|
|
124
|
+
//#endregion
|
|
125
|
+
export { CborTagValue, VerifiedPersonalArcblockJwt, VerifiedPersonalOcapTx, decodeAndVerifyPersonalArcblockJwt, decodeAndVerifyPersonalOcapTx, deriveOcapIdentitiesFromChildPoint, estimateOcapExecutionCostUpperBound, resolveRequiredOcapPolicyTier };
|