mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 20:59:23 +00:00
Move FROST to Read
Fixes https://github.com/serai-dex/serai/issues/33 and https://github.com/serai-dex/serai/issues/35. Also fixes a few potential panics/DoS AFAICT.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use core::{marker::PhantomData, fmt::Debug};
|
||||
use std::io::Read;
|
||||
|
||||
use rand_core::{RngCore, CryptoRng};
|
||||
|
||||
@@ -28,11 +29,11 @@ pub trait Algorithm<C: Curve>: Clone {
|
||||
) -> Vec<u8>;
|
||||
|
||||
/// Proccess the addendum for the specified participant. Guaranteed to be ordered
|
||||
fn process_addendum(
|
||||
fn process_addendum<Re: Read>(
|
||||
&mut self,
|
||||
params: &FrostView<C>,
|
||||
l: u16,
|
||||
serialized: &[u8],
|
||||
reader: &mut Re,
|
||||
) -> Result<(), FrostError>;
|
||||
|
||||
/// Sign a share with the given secret/nonce
|
||||
@@ -133,11 +134,11 @@ impl<C: Curve, H: Hram<C>> Algorithm<C> for Schnorr<C, H> {
|
||||
vec![]
|
||||
}
|
||||
|
||||
fn process_addendum(
|
||||
fn process_addendum<Re: Read>(
|
||||
&mut self,
|
||||
_: &FrostView<C>,
|
||||
_: u16,
|
||||
_: &[u8],
|
||||
_: &mut Re,
|
||||
) -> Result<(), FrostError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user