shamir

Types

pub type ShamirError {
  NotEnoughShares
  MalformedId
  IdOutOfRange
  DuplicateIds
  MalformedData
  MissingLookupValue
  InvalidStringValue
  InvalidShareNumber
  InvalidThreshold
  NotEnoughSharesForThreshold
  InvalidPadLength
}

Constructors

  • NotEnoughShares
  • MalformedId
  • IdOutOfRange
  • DuplicateIds
  • MalformedData
  • MissingLookupValue
  • InvalidStringValue
  • InvalidShareNumber
  • InvalidThreshold
  • NotEnoughSharesForThreshold
  • InvalidPadLength

Functions

pub fn combine(
  shares: List(String),
) -> Result(String, ShamirError)
pub fn new_share(
  id: Int,
  shares: List(String),
) -> Result(String, ShamirError)
pub fn share(
  secret: String,
  num_shares: Int,
  threshold: Int,
) -> Result(List(String), ShamirError)
pub fn share_with_pad_length(
  secret: String,
  num_shares: Int,
  threshold: Int,
  pad_length: Int,
) -> Result(List(String), ShamirError)
Search Document