Crate bc_components

Source
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§

pub use tags_registry as tags;
pub use tags::register_tags;
pub use tags::register_tags_in;

Modules§

tags_registry
CBOR Tags used or defined by this crate.

Structs§

ARID
An “Apparently Random Identifier” (ARID)
AuthenticationTag
The HMAC authentication tag produced by the encryption process.
Compressed
A compressed binary object.
Digest
A cryptographically secure digest, implemented with SHA-256.
ECPrivateKey
An elliptic curve digital signature algorithm (ECDSA) private key.
ECPublicKey
A compressed elliptic curve digital signature algorithm (ECDSA) compressed public key.
ECUncompressedPublicKey
A compressed elliptic curve digital signature algorithm (ECDSA) uncompressed public key.
Ed25519PrivateKey
An Ed25519 private key.
Ed25519PublicKey
An Ed25519 public key.
EncryptedMessage
A secure encrypted message.
HKDFRng
Nonce
A random nonce (“number used once”).
PrivateKeyBase
Holds unique data from which keys for signing and encryption can be derived.
PrivateKeys
Holds information used to communicate cryptographically with a remote entity.
PublicKeys
Holds information used to communicate cryptographically with a remote entity.
Reference
A globally unique reference to a globally unique object
SSKRGroupSpec
A specification for a group of shares within an SSKR split.
SSKRSecret
A secret to be split into shares.
SSKRShare
An SSKR share.
SSKRSpec
A specification for an SSKR split.
Salt
Random salt used to decorrelate other information.
SchnorrPublicKey
A Schnorr (x-only) elliptic curve public key.
SealedMessage
A sealed message can be sent to anyone, but only the intended recipient can decrypt it.
Seed
SymmetricKey
A symmetric encryption key.
URI
A URI.
UUID
A UUID.
X25519PrivateKey
A Curve25519 private key used for X25519 key agreement.
X25519PublicKey
A Curve25519 public key used for X25519 key agreement.
XID
A XID (eXtensible IDentifier).

Enums§

Dilithium
DilithiumPrivateKey
DilithiumPublicKey
DilithiumSignature
EncapsulationCiphertext
EncapsulationPrivateKey
EncapsulationPublicKey
EncapsulationScheme
Kyber
KyberCiphertext
KyberPrivateKey
KyberPublicKey
SSKRError
Errors that can occur when using the SSKR library.
Signature
A cryptographic signature. Supports ECDSA and Schnorr.
SignatureScheme
SigningOptions
Options for signing a message.
SigningPrivateKey
A private ECDSA, Schnorr or SSH key for signing.
SigningPublicKey
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
DigestProvider
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.
ECKeyBase
A type that represents an elliptic curve digital signature algorithm (ECDSA) key.
ECPublicKeyBase
A type that can provide a single unique elliptic curve digital signature algorithm (ECDSA) uncompressed public key.
Encrypter
PrivateKeyDataProvider
Types can implement to PrivateKeyDataProvider to indicate that they will provide unique data from which keys for signing and encryption can be derived.
PrivateKeysProvider
PublicKeysProvider
ReferenceProvider
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 Spec and Secret.
sskr_generate_using
Generates SSKR shares for the given Spec and Secret using the provided random number generator.