mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Implement FromUniformBytes<64> for dalek_ff_group::Scalar
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -1527,7 +1527,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ciphersuite"
|
name = "ciphersuite"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dalek-ff-group",
|
"dalek-ff-group",
|
||||||
"digest 0.10.7",
|
"digest 0.10.7",
|
||||||
@@ -1980,7 +1980,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dalek-ff-group"
|
name = "dalek-ff-group"
|
||||||
version = "0.4.2"
|
version = "0.4.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crypto-bigint",
|
"crypto-bigint",
|
||||||
"curve25519-dalek",
|
"curve25519-dalek",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ciphersuite"
|
name = "ciphersuite"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
description = "Ciphersuites built around ff/group"
|
description = "Ciphersuites built around ff/group"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/serai-dex/serai/tree/develop/crypto/ciphersuite"
|
repository = "https://github.com/serai-dex/serai/tree/develop/crypto/ciphersuite"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "dalek-ff-group"
|
name = "dalek-ff-group"
|
||||||
version = "0.4.2"
|
version = "0.4.3"
|
||||||
description = "ff/group bindings around curve25519-dalek"
|
description = "ff/group bindings around curve25519-dalek"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/serai-dex/serai/tree/develop/crypto/dalek-ff-group"
|
repository = "https://github.com/serai-dex/serai/tree/develop/crypto/dalek-ff-group"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ use dalek::{
|
|||||||
pub use constants::{ED25519_BASEPOINT_TABLE, RISTRETTO_BASEPOINT_TABLE};
|
pub use constants::{ED25519_BASEPOINT_TABLE, RISTRETTO_BASEPOINT_TABLE};
|
||||||
|
|
||||||
use group::{
|
use group::{
|
||||||
ff::{Field, PrimeField, FieldBits, PrimeFieldBits},
|
ff::{Field, PrimeField, FieldBits, PrimeFieldBits, FromUniformBytes},
|
||||||
Group, GroupEncoding,
|
Group, GroupEncoding,
|
||||||
prime::PrimeGroup,
|
prime::PrimeGroup,
|
||||||
};
|
};
|
||||||
@@ -322,6 +322,12 @@ impl PrimeFieldBits for Scalar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl FromUniformBytes<64> for Scalar {
|
||||||
|
fn from_uniform_bytes(bytes: &[u8; 64]) -> Self {
|
||||||
|
Self::from_bytes_mod_order_wide(bytes)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Sum<Scalar> for Scalar {
|
impl Sum<Scalar> for Scalar {
|
||||||
fn sum<I: Iterator<Item = Scalar>>(iter: I) -> Scalar {
|
fn sum<I: Iterator<Item = Scalar>>(iter: I) -> Scalar {
|
||||||
Self(DScalar::sum(iter))
|
Self(DScalar::sum(iter))
|
||||||
|
|||||||
Reference in New Issue
Block a user