Update visibility of various items in Monero

This commit is contained in:
Luke Parker
2022-08-21 11:06:17 -04:00
parent 60d93c4b2d
commit d596eeee6e
9 changed files with 34 additions and 35 deletions

View File

@@ -14,7 +14,9 @@ pub(crate) mod core;
use self::core::LOG_N;
pub(crate) mod original;
pub use original::GENERATORS as BULLETPROOFS_GENERATORS;
pub(crate) mod plus;
pub use plus::GENERATORS as BULLETPROOFS_PLUS_GENERATORS;
pub(crate) use self::original::OriginalStruct;
pub(crate) use self::plus::PlusStruct;
@@ -118,7 +120,7 @@ impl Bulletproofs {
}
}
pub fn signature_serialize<W: std::io::Write>(&self, w: &mut W) -> std::io::Result<()> {
pub(crate) fn signature_serialize<W: std::io::Write>(&self, w: &mut W) -> std::io::Result<()> {
self.serialize_core(w, |points, w| write_raw_vec(write_point, points, w))
}

View File

@@ -51,9 +51,9 @@ pub enum ClsagError {
#[derive(Clone, PartialEq, Eq, Debug, Zeroize, ZeroizeOnDrop)]
pub struct ClsagInput {
// The actual commitment for the true spend
pub commitment: Commitment,
pub(crate) commitment: Commitment,
// True spend index, offsets, and ring
pub decoys: Decoys,
pub(crate) decoys: Decoys,
}
impl ClsagInput {

View File

@@ -55,13 +55,13 @@ impl ClsagInput {
}
#[derive(Clone, Debug, Zeroize, ZeroizeOnDrop)]
pub struct ClsagDetails {
pub(crate) struct ClsagDetails {
input: ClsagInput,
mask: Scalar,
}
impl ClsagDetails {
pub fn new(input: ClsagInput, mask: Scalar) -> ClsagDetails {
pub(crate) fn new(input: ClsagInput, mask: Scalar) -> ClsagDetails {
ClsagDetails { input, mask }
}
}
@@ -111,10 +111,6 @@ impl ClsagMultisig {
})
}
pub const fn serialized_len() -> usize {
32 + (2 * 32)
}
fn input(&self) -> ClsagInput {
(*self.details.read().unwrap()).as_ref().unwrap().input.clone()
}
@@ -137,7 +133,7 @@ impl Algorithm<Ed25519> for ClsagMultisig {
rng: &mut R,
view: &FrostView<Ed25519>,
) -> Vec<u8> {
let mut serialized = Vec::with_capacity(Self::serialized_len());
let mut serialized = Vec::with_capacity(32 + (2 * 32));
serialized.extend((view.secret_share().0 * self.H).compress().to_bytes());
serialized.extend(write_dleq(rng, self.H, view.secret_share().0));
serialized

View File

@@ -1,6 +1,6 @@
use curve25519_dalek::edwards::EdwardsPoint;
pub(crate) use monero_generators::{hash_to_point as raw_hash_to_point};
pub use monero_generators::{hash_to_point as raw_hash_to_point};
pub fn hash_to_point(key: EdwardsPoint) -> EdwardsPoint {
raw_hash_to_point(key.compress().to_bytes())

View File

@@ -3,7 +3,7 @@ use zeroize::Zeroize;
use curve25519_dalek::{constants::ED25519_BASEPOINT_TABLE, scalar::Scalar, edwards::EdwardsPoint};
pub(crate) mod hash_to_point;
pub use hash_to_point::hash_to_point;
pub use hash_to_point::{raw_hash_to_point, hash_to_point};
pub mod clsag;
pub mod bulletproofs;
@@ -127,7 +127,7 @@ impl RctPrunable {
})
}
pub fn signature_serialize<W: std::io::Write>(&self, w: &mut W) -> std::io::Result<()> {
pub(crate) fn signature_serialize<W: std::io::Write>(&self, w: &mut W) -> std::io::Result<()> {
match self {
RctPrunable::Null => panic!("Serializing RctPrunable::Null for a signature"),
RctPrunable::Clsag { bulletproofs, .. } => {