confium-examples 0.5.0

Runnable example binaries demonstrating Confium threshold cryptography
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Confium CMP20 DKG + sign in Ruby.
#
#   gem install confium
#   ruby threshold_ruby_quickstart.rb

require 'confium'

# DKG: 2-of-3 threshold key
kg = Confium::TC::Cmp20.keygen(threshold: 2, parties: 3)
puts "Public key: #{kg.public_key.bytesize} bytes"
puts "Shares: #{kg.shares.length}"

# Sign with threshold shares
sig = Confium::TC::Cmp20.sign(kg.shares, threshold: 2, message: "hello, threshold world")
puts "Signature: #{sig.bytesize} bytes"
puts "✅ Done"