Docs.rs
  • essential-signer-0.4.0
    • essential-signer 0.4.0
    • Permalink
    • Docs.rs crate page
    • Apache-2.0
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • essentialcontributions
    • Dependencies
      • anyhow ^1.0.89 normal
      • base64 ^0.22.1 normal
      • clap ^4.5.20 normal
      • ed25519-dalek ^2.1.0 normal
      • essential-hash ^0.7.0 normal
      • essential-sign ^0.7.0 normal
      • essential-types ^0.5.0 normal
      • hex ^0.4.3 normal
      • postcard ^1.0.10 normal
      • rand ^0.8.5 normal
      • secp256k1 ^0.30 normal
      • serde ^1.0.210 normal
      • serde_bytes ^0.11.14 normal
      • serde_json ^1.0.128 normal
      • sha2 ^0.10.8 normal
    • Versions
    • 100% of the crate is documented
  • Platform
    • i686-unknown-linux-gnu
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate essential_signer

essential_signer0.4.0

  • All Items

Sections

  • Essential Signer

Crate Items

  • Re-exports
  • Enums
  • Functions

Crates

  • essential_signer

Crate essential_signer

Source
Expand description

§Essential Signer

This crate provides a simple API for signing data with various cryptographic schemes. It is designed to be used with the Essential protocol. There is functionality to make word aligning data for use in decision variables easy.

Note that all hashing in this crate is done with sha256. This may change in the future to allow more types of hashing. You can use sign_hash if you wish to hash the data with a different algorithm.

Re-exports§

pub use ed25519_dalek;
pub use secp256k1;

Enums§

Encoding
The encoding to use when decoding or encoding a string.
Key
Different types of private keys that can be used for signing.
Padding
Where to pad the data to make it word aligned.
PublicKey
Different types of public keys.
Signature
Different types of signatures that can be produced.

Functions§

align_to_word
Align the data to be word aligned. This will pad the data with zeros at the start or end depending on the padding.
decode_str
Decode a string into a vector of bytes using the given encoding.
encode_str
Encode a vector of bytes into a string using the given encoding.
hash_bytes
Hash the data using sha256.
hash_words
Hash the words using sha256.
into_words
Align and convert the data to words.
is_word_aligned
Check if the data is word aligned.
pad_bytes
Pad the data to be word aligned.
postcard_bytes
Serialize data using postcard.
postcard_bytes_with_padding
Serialize data using postcard and then pad it to be word aligned.
public_key
Get the public key from a private key.
public_key_to_words
Turn any supported public key into bytes that are padded to be word aligned.
read_file
Read a file into a vector of bytes.
sign_aligned_bytes
Sign already word aligned data by hashing and signing the hash.
sign_bytes_unchecked
Sign the data by hashing and signing the hash.
sign_bytes_with_padding
Sign the data by padding it to be word aligned and then hashing and signing the hash.
sign_hash
Sign a already hashed data.
sign_postcard
Sign data by serializing it using postcard and then hashing and signing the hash.
sign_postcard_with_padding
Sign data by serializing it using postcard and then hashing and signing the hash.
sign_words
Sign a slice of words by hashing and signing the hash.
signature_to_aligned_bytes
Turn any supported signature into bytes that are padded to be word aligned.
signature_to_bytes
Turn any supported signature into bytes.
signature_to_words
Turn any supported signature into words.
signed_set_to_bytes
Serialize a signed contract to json bytes.
to_essential_signature
Turn a secp256k1 signature into an essential signature.

Results

Settings
Help
    enum
    essential_signer::Key
    Different types of private keys that can be used for …
    enum
    essential_signer::PublicKey
    Different types of public keys.
    function
    essential_signer::public_key
    Get the public key from a private key.
    function
    essential_signer::public_key_to_words
    Turn any supported public key into bytes that are padded …
    method
    essential_signer::Key::clone
    &Key -> Key
    function
    essential_signer::public_key
    &Key -> PublicKey
    Get the public key from a private key.
    function
    essential_signer::sign_hash
    Hash, &Key -> Result<Signature>
    Sign a already hashed data.
    function
    essential_signer::sign_words
    &[Word], &Key -> Result<Signature>
    Sign a slice of words by hashing and signing the hash.
    function
    essential_signer::sign_postcard
    &T, &Key -> Result<Signature>
    Sign data by serializing it using postcard and then …
    function
    essential_signer::sign_aligned_bytes
    &[u8], &Key -> Result<Signature>
    Sign already word aligned data by hashing and signing the …
    function
    essential_signer::sign_bytes_unchecked
    &[u8], &Key -> Result<Signature>
    Sign the data by hashing and signing the hash.
    function
    essential_signer::sign_bytes_with_padding
    Vec<u8>, Padding, &Key -> Result<Signature>
    Sign the data by padding it to be word aligned and then …
    function
    essential_signer::sign_postcard_with_padding
    &T, Padding, &Key -> Result<Signature>
    Sign data by serializing it using postcard and then …
    method
    essential_signer::Key::clone
    &Key -> Key