mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
dalek_ff_group::FieldElement: FromUniformBytes<64>
This commit is contained in:
@@ -17,7 +17,7 @@ use crypto_bigint::{
|
|||||||
impl_modulus,
|
impl_modulus,
|
||||||
};
|
};
|
||||||
|
|
||||||
use group::ff::{Field, PrimeField, FieldBits, PrimeFieldBits};
|
use group::ff::{Field, PrimeField, FieldBits, PrimeFieldBits, FromUniformBytes};
|
||||||
|
|
||||||
use crate::{u8_from_bool, constant_time, math_op, math};
|
use crate::{u8_from_bool, constant_time, math_op, math};
|
||||||
|
|
||||||
@@ -311,6 +311,12 @@ impl FieldElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl FromUniformBytes<64> for FieldElement {
|
||||||
|
fn from_uniform_bytes(bytes: &[u8; 64]) -> Self {
|
||||||
|
Self::wide_reduce(*bytes)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Sum<FieldElement> for FieldElement {
|
impl Sum<FieldElement> for FieldElement {
|
||||||
fn sum<I: Iterator<Item = FieldElement>>(iter: I) -> FieldElement {
|
fn sum<I: Iterator<Item = FieldElement>>(iter: I) -> FieldElement {
|
||||||
let mut res = FieldElement::ZERO;
|
let mut res = FieldElement::ZERO;
|
||||||
|
|||||||
Reference in New Issue
Block a user