No description
Find a file
Mark Spanbroek 1e2b05fe06 version 0.3.2
2021-05-28 21:50:29 +02:00
.github/workflows Add Continuous Integration 2021-05-28 21:28:21 +02:00
sources@348f1809e6 Add build script that wraps C code for Nim 2021-05-28 21:25:30 +02:00
sss Add build script that wraps C code for Nim 2021-05-28 21:25:30 +02:00
tests Wrap low-level API of the SSS library by dsprenkels 2020-03-16 09:43:48 +01:00
.editorconfig Repo setup 2020-03-16 09:40:14 +01:00
.gitignore Add build script that wraps C code for Nim 2021-05-28 21:25:30 +02:00
.gitmodules Fix submodule url 2021-05-28 21:49:22 +02:00
.tool-versions Add build script that wraps C code for Nim 2021-05-28 21:25:30 +02:00
build.sh Add build script that wraps C code for Nim 2021-05-28 21:25:30 +02:00
license Add license 2020-03-16 10:54:45 +01:00
readme.md Add build script that wraps C code for Nim 2021-05-28 21:25:30 +02:00
sss.nim Add build script that wraps C code for Nim 2021-05-28 21:25:30 +02:00
sss.nimble version 0.3.2 2021-05-28 21:50:29 +02:00

Shamir Secret Sharing

Split a random key into a number of shares. Using a number of these shares the key can be restored.

This is a nim wrapper around the c library by dsprenkels. Only the hazardous low level API is wrapped, so only use this when you know what you're doing.

Examples

Generate a uniform random key:

let key = randomKey()

Create 3 shares of the key, of which 2 are sufficient to restore the key:

let shares = key.shares(2, 3)

Restore the key by combining 2 shares:

let restored = combine(shares[0..1])

Updating to a newer version

Follow these steps when updating the wrapper to a newer version of sss:

  1. update the git submodule in sources/ to point to the new version
  2. run build.sh
  3. update the version in sss.nimble
  4. commit the changes