mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-23 03:59:37 +00:00
docs
This commit is contained in:
parent
d816a0100c
commit
590e37dd3c
2 changed files with 18 additions and 4 deletions
|
@ -8,22 +8,28 @@ use cuprate_epee_encoding::{error, macros::bytes, EpeeValue, Marker};
|
|||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Generate the `HexBytes` struct for `N` lengths.
|
||||
/// Generate `HexBytes` struct(s) for `N` lengths.
|
||||
///
|
||||
/// This is a macro because [`hex::FromHex`] does not implement for a generic `N`:
|
||||
/// This is a macro instead of a `<const N: usize>` implementation
|
||||
/// because [`hex::FromHex`] does not implement for a generic `N`:
|
||||
/// <https://docs.rs/hex/0.4.3/src/hex/lib.rs.html#220-230>
|
||||
macro_rules! generate_hex_array {
|
||||
($(
|
||||
$array_len:literal
|
||||
),* $(,)?) => { paste::paste! {
|
||||
$(
|
||||
#[doc = concat!("Wrapper type that (de)serializes from/to a ", stringify!($array_len), "-byte array.")]
|
||||
#[doc = concat!(
|
||||
"Wrapper type for a ",
|
||||
stringify!($array_len),
|
||||
"-byte array that (de)serializes from/to hexadecimal strings."
|
||||
)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[cfg_attr(feature = "serde", serde(transparent))]
|
||||
#[repr(transparent)]
|
||||
pub struct [<HexBytes $array_len>](
|
||||
#[cfg_attr(feature = "serde", serde(with = "hex::serde"))] pub [u8; $array_len],
|
||||
#[cfg_attr(feature = "serde", serde(with = "hex::serde"))]
|
||||
pub [u8; $array_len],
|
||||
);
|
||||
|
||||
#[cfg(feature = "epee")]
|
||||
|
|
|
@ -212,22 +212,30 @@ pub enum RctSignatures {
|
|||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[cfg_attr(feature = "serde", serde(untagged))]
|
||||
pub enum RctSigPrunable {
|
||||
/// - [`ringct::RctPrunable::AggregateMlsagBorromean`]
|
||||
/// - [`ringct::RctPrunable::MlsagBorromean`]
|
||||
MlsagBorromean {
|
||||
rangeSigs: Vec<RangeSignature>,
|
||||
MGs: Vec<Mg>,
|
||||
},
|
||||
|
||||
/// - [`ringct::RctPrunable::MlsagBulletproofs`]
|
||||
MlsagBulletproofs {
|
||||
nbp: u64,
|
||||
bp: Vec<Bulletproof>,
|
||||
MGs: Vec<Mg>,
|
||||
pseudoOuts: Vec<HexBytes32>,
|
||||
},
|
||||
|
||||
/// - [`ringct::RctPrunable::Clsag`] with [`ringct::bulletproofs::Bulletproof::Original`]
|
||||
ClsagBulletproofs {
|
||||
nbp: u64,
|
||||
bp: Vec<Bulletproof>,
|
||||
CLSAGs: Vec<Clsag>,
|
||||
pseudoOuts: Vec<HexBytes32>,
|
||||
},
|
||||
|
||||
/// - [`ringct::RctPrunable::Clsag`] with [`ringct::bulletproofs::Bulletproof::Plus`]
|
||||
ClsagBulletproofsPlus {
|
||||
nbp: u64,
|
||||
bpp: Vec<BulletproofPlus>,
|
||||
|
|
Loading…
Reference in a new issue