# 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.12.2"
```

## Re-exports§

`pub use tags::GLOBAL_TAGS;`

## Modules§

- CBOR Tags used or defined by this crate.

## Macros§

- A macro for statically defining a CBOR tag constant.
- A macro for accessing the global tags store.

## Structs§

- An “Apparently Random Identifier” (ARID)
- A Curve25519 private key used for X25519 key agreement.
- A Curve25519 public key used for X25519 key agreement.
- The HMAC authentication tag produced by the encryption process.
- A compressed binary object.
- A cryptographically secure digest, implemented with SHA-256.
- An elliptic curve digital signature algorithm (ECDSA) private key.
- A compressed elliptic curve digital signature algorithm (ECDSA) compressed public key.
- A compressed elliptic curve digital signature algorithm (ECDSA) uncompressed public key.
- A secure encrypted message.
- A random nonce (“number used once”).
- Holds unique data from which keys for signing and encryption can be derived.
- Holds information used to communicate cryptographically with a remote entity.
- A specification for a group of shares within an SSKR split.
- A secret to be split into shares.
- An SSKR share.
- A specification for an SSKR split.
- Random salt used to decorrelate other information.
- A Schnorr (x-only) elliptic curve public key.
- A sealed message can be sent to anyone, but only the intended recipient can decrypt it.
- A symmetric encryption key.
- A URI.
- A UUID.

## Enums§

- Errors that can occur when using the SSKR library.
- A cryptographic signature. Supports ECDSA and Schnorr.
- Options for signing a message.
- A private ECDSA, Schnorr or SSH key for signing.
- A public key that can be used for signing. Supports both ECDSA and Schnorr.

## Traits§

- A type that can provide a single unique digest that characterizes its contents.
- A type that represents an elliptic curve digital signature algorithm (ECDSA) key, and can be used to derive a public key.
- A type that represents an elliptic curve digital signature algorithm (ECDSA) key.
- A type that can provide a single unique elliptic curve digital signature algorithm (ECDSA) uncompressed public key.
- Types can implement to
`PrivateKeyDataProvider`

to indicate that they will provide unique data from which keys for signing and encryption can be derived.

## Functions§

- Combines the given SSKR shares into a
`Secret`

. - Generates SSKR shares for the given
`Spec`

and`Secret`

. - Generates SSKR shares for the given
`Spec`

and`Secret`

using the provided random number generator.