mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Simplify Monero key image handling
This commit is contained in:
@@ -13,7 +13,7 @@ pub use curve25519_dalek as dalek;
|
||||
|
||||
use dalek::{
|
||||
constants,
|
||||
traits::Identity,
|
||||
traits::{Identity, IsIdentity},
|
||||
scalar::Scalar as DScalar,
|
||||
edwards::{
|
||||
EdwardsPoint as DPoint,
|
||||
@@ -248,7 +248,7 @@ impl Group for EdwardsPoint {
|
||||
fn random(mut _rng: impl RngCore) -> Self { unimplemented!() }
|
||||
fn identity() -> Self { Self(DPoint::identity()) }
|
||||
fn generator() -> Self { ED25519_BASEPOINT_POINT }
|
||||
fn is_identity(&self) -> Choice { unimplemented!() }
|
||||
fn is_identity(&self) -> Choice { (self.0.is_identity() as u8).into() }
|
||||
fn double(&self) -> Self { *self + self }
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ pub trait Algorithm<C: Curve>: Clone {
|
||||
|
||||
/// Generate an addendum to FROST"s preprocessing stage
|
||||
fn preprocess_addendum<R: RngCore + CryptoRng>(
|
||||
&mut self,
|
||||
rng: &mut R,
|
||||
params: &MultisigView<C>,
|
||||
nonces: &[C::F; 2],
|
||||
@@ -119,6 +120,7 @@ impl<C: Curve, H: Hram<C>> Algorithm<C> for Schnorr<C, H> {
|
||||
}
|
||||
|
||||
fn preprocess_addendum<R: RngCore + CryptoRng>(
|
||||
&mut self,
|
||||
_: &mut R,
|
||||
_: &MultisigView<C>,
|
||||
_: &[C::F; 2],
|
||||
|
||||
@@ -104,7 +104,7 @@ fn preprocess<R: RngCore + CryptoRng, C: Curve, A: Algorithm<C>>(
|
||||
serialized.extend(&C::G_to_bytes(&commitments[1]));
|
||||
|
||||
serialized.extend(
|
||||
&A::preprocess_addendum(
|
||||
¶ms.algorithm.preprocess_addendum(
|
||||
rng,
|
||||
¶ms.view,
|
||||
&nonces
|
||||
|
||||
Reference in New Issue
Block a user