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.5.0
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 features are possible:
- “checks”: The feature 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
- “gmpmee”: Use the library gmpmee for fixed exponentiation. See rug-gmpmee for details
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
- symmetric_
authenticated_ encryption - Symmetric authenticated encrpytion methods according to the specifications
- 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
- Byte
Array Error - Domain
Verifications - Structure containing the verifications for the generic object T with the error type E
- Hash
Error - Error generated by the module [hahsing]
- Integer
- An arbitrary-precision integer.
- Integer
Operation Error - Error in operations with big integer
- Jacobi
Error - Error generated by methods in JacobiTrait
- ModExponentiate
Error - Error im Mod Exponentiate
- NotOdd
Error - Error if the value is not odd
- NotPositive
Error - Error if the value is not positive
- NotPrime
Error - Error generated by methods in IsPrimeTrait
- Small
Prime Error - Error generated by methods in SmallPrimeTrait
Enums§
- Hashable
Message - Enum to represent an element that is hashable
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§
- 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
- IsPrime
Trait - Jacobi
Trait - Operations
Trait - Trait to extend operations of Integer
- Quadratic
Residue Trait - Recursive
Hash Trait - Trait implementing defining an interface for objects implementing a recursive hash function.
- Small
Prime Trait - Functionality on small primes
- ToByte
Arry Trait - Trait to calculate byte length
- 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