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.