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§
- Byte
Array - ByteArray represent a byte of arrays
- Domain
Verifications - Structure containing the verifications for the generic object T with the error type E
- Integer
- An arbitrary-precision integer.
Enums§
- Byte
Array Error - Hash
Error - Hashable
Message - Enum to represent an element that is hashable
- Integer
Error - Number
Theory Error
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§
- Byte
Length Trait - Trait to calculate byte length
- Constants
Trait - Trait to implement constant numbers
- Decode
Trait - Trait to decode from string in different bases
- Encode
Trait - Trait to encode in string in different bases
- Hexa
- Transformation from or to String in hexadecimal according to the specifications
- Number
Theory Method Trait - Operations
Trait - Trait to extend operations of Integer
- Recursive
Hash Trait - Trait implementing defining an interface for objects implementing a recursive hash function.
- Small
Prime Trait - Functionality on small primes
- Verify
Domain Trait - Trait for the verification of a the domain of a strucut
Functions§
- prepare_
fixed_ based_ optimization - Prepare the fixed base exponentiate for the cache