JSPM

@spliterati-sdamashek/shamir

0.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q14160F
  • License MPL-2.0

Arbitrary-length shamir implementation

Package Exports

    Readme

    shamir

    This library is a port of the arbitrary-length per-byte shamir secret sharing implementation from Hashicorp's Vault product.

    I have removed the constant runtime functionality from the galois field arithmetic, as it doesn't really add much to the security of this system.

    Usage

    import {Shamir} from '@spliterati/shamir';
    
    const secret : Uint8Array = ...;
    // ... 
    const shares = Shamir.split(secret, 5, 3);
    
    const reassembled = Shamir.combine([shares[0], shares[3], shares[1]]);
    // arbitrary indices
    
    expect(secret).toEqual(reassembled);