Module signatures

Module signatures 

Source
Expand description

Digital signature processing

This module contains code for processing digital signatures, including calculating message hash to be signed, and calculating signature digest.

The code in this module is based on Tenderdash implementation.

Two main traits are defined:

  • Signable - for objects that can be signed/verified by Tenderdash.
  • Hashable - for objects that can be serialized and hashed by Tenderdash.

All Signable objects are also Hashable, but not vice versa. For example, StateId is Hashable, but not Signable, as it is only part of some other signed objects.

When signing or verifying signature, use Signable::calculate_sign_hash to calculate signature digest and provide it as a digest directly to the signature or verification function.

Traitsยง

Hashable
Calculate hash (sha256) of the data, using algorithms used by Tenderdash.
Signable
Object that can be signed/verified by Tenderdash.