mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-23 12:09:37 +00:00
Visibility fixes
This commit is contained in:
parent
d596eeee6e
commit
3fffea178f
3 changed files with 10 additions and 6 deletions
|
@ -55,13 +55,13 @@ impl ClsagInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Zeroize, ZeroizeOnDrop)]
|
#[derive(Clone, Debug, Zeroize, ZeroizeOnDrop)]
|
||||||
pub(crate) struct ClsagDetails {
|
pub struct ClsagDetails {
|
||||||
input: ClsagInput,
|
input: ClsagInput,
|
||||||
mask: Scalar,
|
mask: Scalar,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ClsagDetails {
|
impl ClsagDetails {
|
||||||
pub(crate) fn new(input: ClsagInput, mask: Scalar) -> ClsagDetails {
|
pub fn new(input: ClsagInput, mask: Scalar) -> ClsagDetails {
|
||||||
ClsagDetails { input, mask }
|
ClsagDetails { input, mask }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,6 +111,10 @@ impl ClsagMultisig {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) const fn serialized_len() -> usize {
|
||||||
|
32 + (2 * 32)
|
||||||
|
}
|
||||||
|
|
||||||
fn input(&self) -> ClsagInput {
|
fn input(&self) -> ClsagInput {
|
||||||
(*self.details.read().unwrap()).as_ref().unwrap().input.clone()
|
(*self.details.read().unwrap()).as_ref().unwrap().input.clone()
|
||||||
}
|
}
|
||||||
|
@ -133,7 +137,7 @@ impl Algorithm<Ed25519> for ClsagMultisig {
|
||||||
rng: &mut R,
|
rng: &mut R,
|
||||||
view: &FrostView<Ed25519>,
|
view: &FrostView<Ed25519>,
|
||||||
) -> Vec<u8> {
|
) -> Vec<u8> {
|
||||||
let mut serialized = Vec::with_capacity(32 + (2 * 32));
|
let mut serialized = Vec::with_capacity(Self::serialized_len());
|
||||||
serialized.extend((view.secret_share().0 * self.H).compress().to_bytes());
|
serialized.extend((view.secret_share().0 * self.H).compress().to_bytes());
|
||||||
serialized.extend(write_dleq(rng, self.H, view.secret_share().0));
|
serialized.extend(write_dleq(rng, self.H, view.secret_share().0));
|
||||||
serialized
|
serialized
|
||||||
|
|
|
@ -17,9 +17,9 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
struct EmptyResponse {}
|
pub struct EmptyResponse {}
|
||||||
#[derive(Deserialize, Debug)]
|
#[derive(Deserialize, Debug)]
|
||||||
struct JsonRpcResponse<T> {
|
pub struct JsonRpcResponse<T> {
|
||||||
result: T,
|
result: T,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ use curve25519_dalek::{
|
||||||
|
|
||||||
const VARINT_CONTINUATION_MASK: u8 = 0b1000_0000;
|
const VARINT_CONTINUATION_MASK: u8 = 0b1000_0000;
|
||||||
|
|
||||||
fn varint_len(varint: usize) -> usize {
|
pub(crate) fn varint_len(varint: usize) -> usize {
|
||||||
((usize::try_from(usize::BITS - varint.leading_zeros()).unwrap().saturating_sub(1)) / 7) + 1
|
((usize::try_from(usize::BITS - varint.leading_zeros()).unwrap().saturating_sub(1)) / 7) + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue