mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Bulletproofs+ (#70)
* Initial stab at Bulletproofs+ Does move around the existing Bulletproofs code, does still work as expected. * Make the Clsag RCTPrunable type work with BP and BP+ * Initial set of BP+ bug fixes * Further bug fixes * Remove RING_LEN as a constant * Monero v16 TX support Doesn't implement view tags, nor going back to v14, nor the updated BP clawback logic. * Support v14 and v16 at the same time
This commit is contained in:
@@ -25,6 +25,32 @@ pub mod wallet;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum Protocol {
|
||||
Unsupported,
|
||||
v14,
|
||||
v16,
|
||||
}
|
||||
|
||||
impl Protocol {
|
||||
pub(crate) fn ring_len(&self) -> usize {
|
||||
match self {
|
||||
Protocol::Unsupported => panic!("Unsupported protocol version"),
|
||||
Protocol::v14 => 11,
|
||||
Protocol::v16 => 16,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn bp_plus(&self) -> bool {
|
||||
match self {
|
||||
Protocol::Unsupported => panic!("Unsupported protocol version"),
|
||||
Protocol::v14 => false,
|
||||
Protocol::v16 => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
static ref H: EdwardsPoint =
|
||||
CompressedEdwardsY(hash(&ED25519_BASEPOINT_POINT.compress().to_bytes()))
|
||||
|
||||
Reference in New Issue
Block a user