mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 11:39:35 +00:00
Move the Monero create to coins/
Includes misc bug fixes
This commit is contained in:
parent
79f39c4433
commit
df4be9ca0c
19 changed files with 13 additions and 3 deletions
4
.gitmodules
vendored
4
.gitmodules
vendored
|
@ -1,3 +1,3 @@
|
|||
[submodule "sign/monero/c/monero"]
|
||||
path = sign/monero/c/monero
|
||||
[submodule "coins/monero/c/monero"]
|
||||
path = coins/monero/c/monero
|
||||
url = https://github.com/monero-project/monero
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
members = [
|
||||
"sign/frost",
|
||||
"sign/dalek-ff-group",
|
||||
"sign/monero",
|
||||
"coins/monero",
|
||||
]
|
||||
|
|
|
@ -8,6 +8,7 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
rand_core = "0.6"
|
||||
digest = "0.10"
|
||||
|
||||
subtle = "2.4"
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ use core::{
|
|||
};
|
||||
|
||||
use rand_core::RngCore;
|
||||
use digest::{consts::U64, Digest};
|
||||
|
||||
use subtle::{Choice, CtOption, ConstantTimeEq, ConditionallySelectable};
|
||||
|
||||
|
@ -146,6 +147,14 @@ impl PrimeField for Scalar {
|
|||
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)]
|
||||
pub struct EdwardsPoint(pub DPoint);
|
||||
pub const ED25519_BASEPOINT_POINT: EdwardsPoint = EdwardsPoint(constants::ED25519_BASEPOINT_POINT);
|
||||
|
|
Loading…
Reference in a new issue