Expand description
Extra Rust Crypto elliptic-curve adaptors, functions, and macros
There are some methods that can be applied to many different elliptic curves fields and groups.
This crate provides multi-exponentiation functions and serialization for different types of scalars and groups. Serialization doesn’t use any allocations and is no_std compliant.
In addition with the alloc or std feature, it can
handle serializing Vec as well.
To permit serializing a [PrimeField]
use elliptic_curve_tools::prime_field;
use elliptic_curve::PrimeField;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct PrimeFieldWrapper<F: PrimeField>( #[serde(with = "prime_field")] F);To permit serializing a [Group]
use elliptic_curve_tools::group;
use elliptic_curve::{Group, group::GroupEncoding};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct GroupWrapper<G: Group>( #[serde(with = "group")] G);Other collections can also be serialized like
- Fixed sized arrays like [[
PrimeField]; 32] or [[Group + GroupEncoding]; 32]
Modules§
- Serialize and deserialize a group element.
- Serialize and deserialize a group element array.
- Serialize and deserialize a prime field element.
- Serialize and deserialize a prime field element array.
Traits§
- A trait for a group that can compute the sum of products of a slice of group elements and a slice of scalars. The length of the slices must be equal.