mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Move the Monero create to coins/
Includes misc bug fixes
This commit is contained in:
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
|||||||
[submodule "sign/monero/c/monero"]
|
[submodule "coins/monero/c/monero"]
|
||||||
path = sign/monero/c/monero
|
path = coins/monero/c/monero
|
||||||
url = https://github.com/monero-project/monero
|
url = https://github.com/monero-project/monero
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
members = [
|
members = [
|
||||||
"sign/frost",
|
"sign/frost",
|
||||||
"sign/dalek-ff-group",
|
"sign/dalek-ff-group",
|
||||||
"sign/monero",
|
"coins/monero",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rand_core = "0.6"
|
rand_core = "0.6"
|
||||||
|
digest = "0.10"
|
||||||
|
|
||||||
subtle = "2.4"
|
subtle = "2.4"
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use core::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use rand_core::RngCore;
|
use rand_core::RngCore;
|
||||||
|
use digest::{consts::U64, Digest};
|
||||||
|
|
||||||
use subtle::{Choice, CtOption, ConstantTimeEq, ConditionallySelectable};
|
use subtle::{Choice, CtOption, ConstantTimeEq, ConditionallySelectable};
|
||||||
|
|
||||||
@@ -146,6 +147,14 @@ impl PrimeField for Scalar {
|
|||||||
fn root_of_unity() -> Self { unimplemented!() }
|
fn root_of_unity() -> Self { unimplemented!() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Scalar {
|
||||||
|
pub fn from_hash<D: Digest<OutputSize = U64>>(hash: D) -> Scalar {
|
||||||
|
let mut output = [0u8; 64];
|
||||||
|
output.copy_from_slice(&hash.finalize());
|
||||||
|
Scalar(DScalar::from_bytes_mod_order_wide(&output))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||||
pub struct EdwardsPoint(pub DPoint);
|
pub struct EdwardsPoint(pub DPoint);
|
||||||
pub const ED25519_BASEPOINT_POINT: EdwardsPoint = EdwardsPoint(constants::ED25519_BASEPOINT_POINT);
|
pub const ED25519_BASEPOINT_POINT: EdwardsPoint = EdwardsPoint(constants::ED25519_BASEPOINT_POINT);
|
||||||
|
|||||||
Reference in New Issue
Block a user