Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sonr Crypto

Cryptographic primitives used by Sonr: elliptic-curve arithmetic, threshold signatures, multi-party computation, zero-knowledge proofs, and the identity layer built on top of them.

Documentation: https://sonr-io.github.io/crypto

go get github.com/sonr-io/crypto

Requires Go 1.24.7 or newer.

Warning

This library has no public security audit, and several packages contain stubs or known defects. Read the security notes before depending on any of it.

Packages

Foundations

  • core/curves: the Curve / Point / Scalar abstraction every other package is written against, with secp256k1, NIST P-256, Ed25519, Pallas, BLS12-381, and BLS12-377.
  • core: modular arithmetic, hash-to-field, HMAC commitments, and safe-prime generation.
  • core/protocol: the message and iterator types that drive multi-round protocols.

Symmetric and key derivation

  • aead: AES-256-GCM with generated, prepended nonces.
  • daed: AES-SIV-CMAC deterministic AEAD (RFC 5297).
  • argon2: Argon2id password hashing and key derivation.
  • subtle: HKDF, X25519, and hash/curve name helpers.
  • salt, password, secure: salt handling, password policy, and memory-hygiene helpers.

Signatures

  • signatures/bls: BLS signatures with aggregation, proof of possession, and threshold key generation.
  • signatures/bbs: BBS+ signatures for selective disclosure and blind signing.
  • signatures/schnorr: Mina (Pallas/Poseidon) and NEM (Ed25519-Keccak) schemes.
  • ecdsa: low-S canonicalization and RFC 6979 deterministic signing.
  • vrf: verifiable random function over Edwards25519.

Threshold cryptography and MPC

  • sharing: Shamir, Feldman, and Pedersen secret sharing.
  • dkg: FROST and Gennaro distributed key generation.
  • tecdsa: two-party threshold ECDSA (DKLs18) with key refresh.
  • ted25519: threshold Ed25519 and FROST threshold Schnorr signing.
  • ot: base oblivious transfer and correlated OT extension — building blocks for the above.
  • mpc: threshold ECDSA packaged as a single enclave value: keygen, sign, verify, refresh.

Zero-knowledge

  • zkp/schnorr: non-interactive proof of knowledge of a discrete log.
  • accumulator: pairing-based accumulator with constant-size membership proofs.
  • bulletproof: inner-product argument and range proofs.
  • paillier: additively homomorphic encryption with a square-free modulus proof.

Identity

  • keys: did:key encoding and decoding over libp2p public keys.
  • ucan: UCAN capability tokens, attenuation, and verification.
  • ecies: ECIES payload encryption over secp256k1.
  • wasm: Ed25519 signing and hash pinning for WebAssembly modules.

Documentation

The site under docs/ is built with Blume and deployed to GitHub Pages by .github/workflows/docs.yml.

npm ci
npm run dev    # local preview with hot reload
npm run build  # static output to dist/

License

This project is licensed under the Apache 2.0 License.

Releases

Packages

Used by

Contributors

Languages