[{"name":"Secret","comment":" An implementation of [Shamir's Secret Sharing](https://en.wikipedia.org/wiki/Shamir's_Secret_Sharing):\nyour secret is encrypted into `N` keys, of which only `K` are needed to\nreconstruct the original secret.\n\nPort of [`simbo1905/shamir`](https://github.com/simbo1905/shamir).\n\n\n## Advanced usage:\n\nIt's possible to have a tiered sharing: let's say you want to have admin keys and\nuser keys; allowing either two admin keys or one admin key and three users to\nrecover the secret.\n\nFor more info check [this link](https://github.com/simbo1905/shamir#tiered-sharing-java).\n\n\n# Encrypt\n\n@docs encryptBytes, encryptString, EncryptError\n\n\n# Decrypt\n\n@docs decryptBytes, decryptString, DecryptError\n\n","unions":[{"name":"DecryptError","comment":" The library will fail decrypting if:\n\n  - the keys list is empty\n  - keys are not of the same length\n  - the secret wasn't an UTF-8 string and you attempted to `decryptString`\n\n","args":[],"cases":[["NoKeysProvided",[]],["KeysNotSameLength",[]],["NotAnUtf8String",[]]]},{"name":"EncryptError","comment":" These validation rules are in effect:\n\n  - 2-255 parts must be generated\n  - 2+ parts must be needed\n  - there cannot be more parts needed than available\n  - secret must be non-empty Bytes (Strings can be empty)\n\n","args":[],"cases":[["TooFewPartsNeeded",[]],["TooManyParts",[]],["MorePartsNeededThanAvailable",[]],["NoSecret",[]]]}],"aliases":[],"values":[{"name":"decryptBytes","comment":" Allows deconstructing the Bytes secret from the given keys.\n","type":"List.List Secret.Key.Internal.Key -> Result.Result Secret.DecryptError Bytes.Bytes"},{"name":"decryptString","comment":" Allows deconstructing the String secret from the given keys.\n\nCompared to `decryptBytes`, requires one extra 32bit integer at the beginning,\nsaying how many UTF-8 bytes the string has. This is given automatically during\nencryption with `encryptString`.\n\n","type":"List.List Secret.Key.Internal.Key -> Result.Result Secret.DecryptError String.String"},{"name":"encryptBytes","comment":" Allows splitting the Bytes secret to a given number of keys.\n","type":"{ seed : Random.Seed, parts : Basics.Int, minPartsNeeded : Basics.Int } -> Bytes.Bytes -> Result.Result Secret.EncryptError (List.List Secret.Key.Internal.Key)"},{"name":"encryptString","comment":" Allows splitting the String secret to a given number of keys.\n\nCompared to `encryptBytes`, adds one extra 32bit integer at the beginning, saying\nhow many UTF-8 bytes the string has. This is required for correct reconstruction\nlater with `decryptString`.\n\n","type":"{ seed : Random.Seed, parts : Basics.Int, minPartsNeeded : Basics.Int } -> String.String -> Result.Result Secret.EncryptError (List.List Secret.Key.Internal.Key)"}],"binops":[]},{"name":"Secret.Key","comment":"\n\n@docs Key, fromList, toList\n\n","unions":[],"aliases":[{"name":"Key","comment":" A key used to reconstruct the secret.\n\nCan be thought of as a set of points on a given `x = constant` vertical line.\n\n","args":[],"type":"Secret.Key.Internal.Key"}],"values":[{"name":"fromList","comment":" Construct a Key from a list of points on a vertical line.\n\nMostly useful for deserialization.\n\nIn case you want to create these by hand, note the integers in the list must be\nin the 0-255 range, and the first integer in the tuple must be greater than 0.\n\n","type":"( Basics.Int, List.List Basics.Int ) -> Secret.Key.Key"},{"name":"toList","comment":" Convert a Key to a list of points on a vertical line.\n\nMostly useful for serialization.\n\n","type":"Secret.Key.Key -> ( Basics.Int, List.List Basics.Int )"}],"binops":[]}]