add vault first time control

This commit is contained in:
Ada
2026-01-30 21:26:38 -08:00
parent fb1377eb4b
commit 218b2e8b29
3 changed files with 216 additions and 20 deletions

View File

@@ -1,11 +1,16 @@
/**
* Shamir's Secret Sharing (SSS) Implementation
*
*
* This implements a (3,2) threshold scheme where:
* - Secret is split into 3 shares
* - Any 2 shares can recover the original secret
*
* Based on the Sentinel crypto_core_demo Python implementation.
*
* Correspondence with crypto_core_demo (Python):
* - sp_trust_sharding.py: split_to_shares(), recover_from_shares()
* - Same algorithm: f(x) = secret + a*x (mod P), Lagrange interpolation
* - Difference: entropy conversion. Python uses BIP-39 (mnemonic.to_entropy);
* we use custom word list index-based encoding for compatibility with
* existing MNEMONIC_WORDS. SSS split/recover logic is identical.
*/
// Use a large prime for the finite field