Expand description
§Introduction
A collection of useful primitives for cryptography, semantic graphs, and cryptocurrency, primarily for use in higher-level Blockchain Commons projects like Gordian Envelope. All the types are CBOR serializable, and a number of them can also be serialized to and from URs.
Also includes a library of CBOR tags and UR types for use with these types.
§Getting Started
[dependencies]
bc-components = "0.16.0"Re-exports§
Modules§
- tags_
registry - CBOR Tags used or defined by this crate.
Structs§
- ARID
- An “Apparently Random Identifier” (ARID)
- Authentication
Tag - The HMAC authentication tag produced by the encryption process.
- Compressed
- A compressed binary object.
- Digest
- A cryptographically secure digest, implemented with SHA-256.
- ECPrivate
Key - An elliptic curve digital signature algorithm (ECDSA) private key.
- ECPublic
Key - A compressed elliptic curve digital signature algorithm (ECDSA) compressed public key.
- ECUncompressed
Public Key - A compressed elliptic curve digital signature algorithm (ECDSA) uncompressed public key.
- Ed25519
Private Key - An Ed25519 private key.
- Ed25519
Public Key - An Ed25519 public key.
- Encrypted
Message - A secure encrypted message.
- HKDFRng
- Nonce
- A random nonce (“number used once”).
- Private
KeyBase - Holds unique data from which keys for signing and encryption can be derived.
- Private
Keys - Holds information used to communicate cryptographically with a remote entity.
- Public
Keys - Holds information used to communicate cryptographically with a remote entity.
- Reference
- A globally unique reference to a globally unique object
- SSKR
Group Spec - A specification for a group of shares within an SSKR split.
- SSKR
Secret - A secret to be split into shares.
- SSKR
Share - An SSKR share.
- SSKR
Spec - A specification for an SSKR split.
- Salt
- Random salt used to decorrelate other information.
- Schnorr
Public Key - A Schnorr (x-only) elliptic curve public key.
- Sealed
Message - A sealed message can be sent to anyone, but only the intended recipient can decrypt it.
- Seed
- Symmetric
Key - A symmetric encryption key.
- URI
- A URI.
- UUID
- A UUID.
- X25519
Private Key - A Curve25519 private key used for X25519 key agreement.
- X25519
Public Key - A Curve25519 public key used for X25519 key agreement.
- XID
- A XID (eXtensible IDentifier).
Enums§
- Dilithium
- Dilithium
Private Key - Dilithium
Public Key - Dilithium
Signature - Encapsulation
Ciphertext - Encapsulation
Private Key - Encapsulation
Public Key - Encapsulation
Scheme - Kyber
- Kyber
Ciphertext - Kyber
Private Key - Kyber
Public Key - SSKR
Error - Errors that can occur when using the SSKR library.
- Signature
- A cryptographic signature. Supports ECDSA and Schnorr.
- Signature
Scheme - Signing
Options - Options for signing a message.
- Signing
Private Key - A private ECDSA, Schnorr or SSH key for signing.
- Signing
Public Key - A public key that can be used for signing. Supports both ECDSA and Schnorr.
Constants§
- ECDSA_
PRIVATE_ KEY_ SIZE - ECDSA_
PUBLIC_ KEY_ SIZE - ECDSA_
UNCOMPRESSED_ PUBLIC_ KEY_ SIZE - SCHNORR_
PUBLIC_ KEY_ SIZE
Traits§
- Decrypter
- Digest
Provider - A type that can provide a single unique digest that characterizes its contents.
- ECKey
- A type that represents an elliptic curve digital signature algorithm (ECDSA) key, and can be used to derive a public key.
- ECKey
Base - A type that represents an elliptic curve digital signature algorithm (ECDSA) key.
- ECPublic
KeyBase - A type that can provide a single unique elliptic curve digital signature algorithm (ECDSA) uncompressed public key.
- Encrypter
- Private
KeyData Provider - Types can implement to
PrivateKeyDataProviderto indicate that they will provide unique data from which keys for signing and encryption can be derived. - Private
Keys Provider - Public
Keys Provider - Reference
Provider - Implementers of this trait provide a globally unique reference to themselves.
- Signer
- Verifier
- XIDProvider
Functions§
- keypair
- keypair_
opt - keypair_
opt_ using - keypair_
using - sskr_
combine - Combines the given SSKR shares into a
Secret. - sskr_
generate - Generates SSKR shares for the given
SpecandSecret. - sskr_
generate_ using - Generates SSKR shares for the given
SpecandSecretusing the provided random number generator.