Crate rust_ev_crypto_primitives

Source
Expand description

Crate implementing the cryptographic functions for E-Voting

It is based on the specifications of Swiss Post, according to the following document version: Crypo-primitives, version 1.4.1

The crate reduces actually at the necessary functions for the Verifier. The crate is grouped in modules releated to themes, like the specifications

The module crate::basic_crypto_functions contains a wrapper to openssl. Details about installation and functionalities can be found on the crate openssl.

The crate ist based on rug that is strongly performant, but GMP must be installed for compilation. See the requirements and installation path in the crate documentation rug

If a method should return an error, then each error type is specified per module and is transparent to the user of the crate.

§Features

Following feature is possible:

  • “checks”: The library will perform checks of the input data, according to the specifications of Swiss Post. This reduces the performance. If the checks are performed during the usage of the crate, it is recommended, not to activate the feature

Modules§

alphabets
Implementation the algorithms for strings and alphabets
argon2
Module that implement key derivation functions with argon2id
basic_crypto_functions
Module to wrap the openssl library for crypto functions
direct_trust
Module implementing the direct trust
elgamal
Implementation of El Gamal functionalitiies
mix_net
Module implementing the algorithm for the the mixnet
random
Module that implement random functions
signature
Implementation of the verification of the signature
string
Implementation the algorithms for strings
zero_knowledge_proofs
Implementation of the necessary algorithms used for the zero-knowledge proofs of Swiss Post:

Structs§

ByteArray
ByteArray represent a byte of arrays
DomainVerifications
Structure containing the verifications for the generic object T with the error type E
Integer
An arbitrary-precision integer.

Enums§

ByteArrayError
HashError
HashableMessage
Enum to represent an element that is hashable
IntegerError
NumberTheoryError

Constants§

GROUP_PARAMETER_P_LENGTH
The length of the group parameter p according to the security level in the specifications
GROUP_PARAMETER_Q_LENGTH
The length of the group parameter q according to the security level in the specifications
SECURITY_STRENGTH
The security length according to the security level in the specifications

Traits§

ByteLengthTrait
Trait to calculate byte length
ConstantsTrait
Trait to implement constant numbers
DecodeTrait
Trait to decode from string in different bases
EncodeTrait
Trait to encode in string in different bases
Hexa
Transformation from or to String in hexadecimal according to the specifications
NumberTheoryMethodTrait
OperationsTrait
Trait to extend operations of Integer
RecursiveHashTrait
Trait implementing defining an interface for objects implementing a recursive hash function.
SmallPrimeTrait
Functionality on small primes
VerifyDomainTrait
Trait for the verification of a the domain of a strucut

Functions§

prepare_fixed_based_optimization
Prepare the fixed base exponentiate for the cache