2022-07-09 22:53:52 +00:00
|
|
|
use core::cmp::Ordering;
|
2023-01-07 10:18:35 +00:00
|
|
|
use std::io::{self, Read, Write};
|
2022-07-09 22:53:52 +00:00
|
|
|
|
Utilize zeroize (#76)
* Apply Zeroize to nonces used in Bulletproofs
Also makes bit decomposition constant time for a given amount of
outputs.
* Fix nonce reuse for single-signer CLSAG
* Attach Zeroize to most structures in Monero, and ZOnDrop to anything with private data
* Zeroize private keys and nonces
* Merge prepare_outputs and prepare_transactions
* Ensure CLSAG is constant time
* Pass by borrow where needed, bug fixes
The past few commitments have been one in-progress chunk which I've
broken up as best read.
* Add Zeroize to FROST structs
Still needs to zeroize internally, yet next step. Not quite as
aggressive as Monero, partially due to the limitations of HashMaps,
partially due to less concern about metadata, yet does still delete a
few smaller items of metadata (group key, context string...).
* Remove Zeroize from most Monero multisig structs
These structs largely didn't have private data, just fields with private
data, yet those fields implemented ZeroizeOnDrop making them already
covered. While there is still traces of the transaction left in RAM,
fully purging that was never the intent.
* Use Zeroize within dleq
bitvec doesn't offer Zeroize, so a manual zeroing has been implemented.
* Use Zeroize for random_nonce
It isn't perfect, due to the inability to zeroize the digest, and due to
kp256 requiring a few transformations. It does the best it can though.
Does move the per-curve random_nonce to a provided one, which is allowed
as of https://github.com/cfrg/draft-irtf-cfrg-frost/pull/231.
* Use Zeroize on FROST keygen/signing
* Zeroize constant time multiexp.
* Correct when FROST keygen zeroizes
* Move the FROST keys Arc into FrostKeys
Reduces amount of instances in memory.
* Manually implement Debug for FrostCore to not leak the secret share
* Misc bug fixes
* clippy + multiexp test bug fixes
* Correct FROST key gen share summation
It leaked our own share for ourself.
* Fix cross-group DLEq tests
2022-08-03 08:25:18 +00:00
|
|
|
use zeroize::Zeroize;
|
|
|
|
|
2022-09-28 09:28:42 +00:00
|
|
|
use curve25519_dalek::{
|
|
|
|
scalar::Scalar,
|
|
|
|
edwards::{EdwardsPoint, CompressedEdwardsY},
|
|
|
|
};
|
2022-05-21 19:33:35 +00:00
|
|
|
|
2022-07-15 05:26:07 +00:00
|
|
|
use crate::{
|
2022-08-21 14:35:10 +00:00
|
|
|
Protocol, hash,
|
2022-07-15 05:26:07 +00:00
|
|
|
serialize::*,
|
2022-09-28 09:28:42 +00:00
|
|
|
ringct::{RctBase, RctPrunable, RctSignatures},
|
2022-07-15 05:26:07 +00:00
|
|
|
};
|
2022-05-21 19:33:35 +00:00
|
|
|
|
2022-07-22 06:34:36 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
2022-05-21 19:33:35 +00:00
|
|
|
pub enum Input {
|
|
|
|
Gen(u64),
|
2022-07-15 05:26:07 +00:00
|
|
|
ToKey { amount: u64, key_offsets: Vec<u64>, key_image: EdwardsPoint },
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Input {
|
2022-06-19 16:03:01 +00:00
|
|
|
// Worst-case predictive len
|
2022-07-27 09:05:43 +00:00
|
|
|
pub(crate) fn fee_weight(ring_len: usize) -> usize {
|
2022-06-19 16:03:01 +00:00
|
|
|
// Uses 1 byte for the VarInt amount due to amount being 0
|
|
|
|
// Uses 1 byte for the VarInt encoding of the length of the ring as well
|
2022-07-27 09:05:43 +00:00
|
|
|
1 + 1 + 1 + (8 * ring_len) + 32
|
2022-06-19 16:03:01 +00:00
|
|
|
}
|
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
pub fn write<W: Write>(&self, w: &mut W) -> io::Result<()> {
|
2022-05-21 19:33:35 +00:00
|
|
|
match self {
|
|
|
|
Input::Gen(height) => {
|
2022-05-22 01:35:25 +00:00
|
|
|
w.write_all(&[255])?;
|
2022-05-21 19:33:35 +00:00
|
|
|
write_varint(height, w)
|
2022-07-15 05:26:07 +00:00
|
|
|
}
|
2022-05-21 19:33:35 +00:00
|
|
|
|
|
|
|
Input::ToKey { amount, key_offsets, key_image } => {
|
|
|
|
w.write_all(&[2])?;
|
|
|
|
write_varint(amount, w)?;
|
|
|
|
write_vec(write_varint, key_offsets, w)?;
|
|
|
|
write_point(key_image, w)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-05-22 00:27:21 +00:00
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
pub fn read<R: Read>(r: &mut R) -> io::Result<Input> {
|
2022-08-21 08:41:55 +00:00
|
|
|
Ok(match read_byte(r)? {
|
2022-07-15 05:26:07 +00:00
|
|
|
255 => Input::Gen(read_varint(r)?),
|
|
|
|
2 => Input::ToKey {
|
|
|
|
amount: read_varint(r)?,
|
|
|
|
key_offsets: read_vec(read_varint, r)?,
|
2022-08-30 05:02:55 +00:00
|
|
|
key_image: read_torsion_free_point(r)?,
|
2022-07-15 05:26:07 +00:00
|
|
|
},
|
2023-01-07 10:18:35 +00:00
|
|
|
_ => {
|
|
|
|
Err(io::Error::new(io::ErrorKind::Other, "Tried to deserialize unknown/unused input type"))?
|
|
|
|
}
|
2022-07-15 05:26:07 +00:00
|
|
|
})
|
2022-05-22 00:27:21 +00:00
|
|
|
}
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Doesn't bother moving to an enum for the unused Script classes
|
2022-07-22 06:34:36 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
2022-05-21 19:33:35 +00:00
|
|
|
pub struct Output {
|
|
|
|
pub amount: u64,
|
2022-08-30 05:02:55 +00:00
|
|
|
pub key: CompressedEdwardsY,
|
2022-07-27 10:29:14 +00:00
|
|
|
pub view_tag: Option<u8>,
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Output {
|
2022-06-19 16:03:01 +00:00
|
|
|
pub(crate) fn fee_weight() -> usize {
|
|
|
|
1 + 1 + 32 + 1
|
|
|
|
}
|
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
pub fn write<W: Write>(&self, w: &mut W) -> io::Result<()> {
|
2022-05-21 19:33:35 +00:00
|
|
|
write_varint(&self.amount, w)?;
|
2022-09-17 08:35:08 +00:00
|
|
|
w.write_all(&[2 + u8::from(self.view_tag.is_some())])?;
|
2022-08-30 05:02:55 +00:00
|
|
|
w.write_all(&self.key.to_bytes())?;
|
2022-07-27 10:29:14 +00:00
|
|
|
if let Some(view_tag) = self.view_tag {
|
|
|
|
w.write_all(&[view_tag])?;
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
}
|
2022-05-22 00:27:21 +00:00
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
pub fn read<R: Read>(r: &mut R) -> io::Result<Output> {
|
2022-05-22 00:27:21 +00:00
|
|
|
let amount = read_varint(r)?;
|
2022-08-21 08:41:55 +00:00
|
|
|
let view_tag = match read_byte(r)? {
|
2022-07-27 10:29:14 +00:00
|
|
|
2 => false,
|
|
|
|
3 => true,
|
2023-01-07 10:18:35 +00:00
|
|
|
_ => Err(io::Error::new(
|
|
|
|
io::ErrorKind::Other,
|
2022-07-15 05:26:07 +00:00
|
|
|
"Tried to deserialize unknown/unused output type",
|
2022-07-27 10:29:14 +00:00
|
|
|
))?,
|
|
|
|
};
|
2022-05-22 00:27:21 +00:00
|
|
|
|
2022-07-15 05:26:07 +00:00
|
|
|
Ok(Output {
|
|
|
|
amount,
|
2022-08-30 05:02:55 +00:00
|
|
|
key: CompressedEdwardsY(read_bytes(r)?),
|
2022-08-21 08:41:55 +00:00
|
|
|
view_tag: if view_tag { Some(read_byte(r)?) } else { None },
|
2022-07-15 05:26:07 +00:00
|
|
|
})
|
2022-05-22 00:27:21 +00:00
|
|
|
}
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
|
Utilize zeroize (#76)
* Apply Zeroize to nonces used in Bulletproofs
Also makes bit decomposition constant time for a given amount of
outputs.
* Fix nonce reuse for single-signer CLSAG
* Attach Zeroize to most structures in Monero, and ZOnDrop to anything with private data
* Zeroize private keys and nonces
* Merge prepare_outputs and prepare_transactions
* Ensure CLSAG is constant time
* Pass by borrow where needed, bug fixes
The past few commitments have been one in-progress chunk which I've
broken up as best read.
* Add Zeroize to FROST structs
Still needs to zeroize internally, yet next step. Not quite as
aggressive as Monero, partially due to the limitations of HashMaps,
partially due to less concern about metadata, yet does still delete a
few smaller items of metadata (group key, context string...).
* Remove Zeroize from most Monero multisig structs
These structs largely didn't have private data, just fields with private
data, yet those fields implemented ZeroizeOnDrop making them already
covered. While there is still traces of the transaction left in RAM,
fully purging that was never the intent.
* Use Zeroize within dleq
bitvec doesn't offer Zeroize, so a manual zeroing has been implemented.
* Use Zeroize for random_nonce
It isn't perfect, due to the inability to zeroize the digest, and due to
kp256 requiring a few transformations. It does the best it can though.
Does move the per-curve random_nonce to a provided one, which is allowed
as of https://github.com/cfrg/draft-irtf-cfrg-frost/pull/231.
* Use Zeroize on FROST keygen/signing
* Zeroize constant time multiexp.
* Correct when FROST keygen zeroizes
* Move the FROST keys Arc into FrostKeys
Reduces amount of instances in memory.
* Manually implement Debug for FrostCore to not leak the secret share
* Misc bug fixes
* clippy + multiexp test bug fixes
* Correct FROST key gen share summation
It leaked our own share for ourself.
* Fix cross-group DLEq tests
2022-08-03 08:25:18 +00:00
|
|
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Zeroize)]
|
2022-06-02 04:00:26 +00:00
|
|
|
pub enum Timelock {
|
|
|
|
None,
|
|
|
|
Block(usize),
|
2022-07-15 05:26:07 +00:00
|
|
|
Time(u64),
|
2022-06-02 04:00:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Timelock {
|
|
|
|
fn from_raw(raw: u64) -> Timelock {
|
|
|
|
if raw == 0 {
|
|
|
|
Timelock::None
|
|
|
|
} else if raw < 500_000_000 {
|
|
|
|
Timelock::Block(usize::try_from(raw).unwrap())
|
|
|
|
} else {
|
|
|
|
Timelock::Time(raw)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
fn write<W: Write>(&self, w: &mut W) -> io::Result<()> {
|
2022-06-02 04:00:26 +00:00
|
|
|
write_varint(
|
|
|
|
&match self {
|
|
|
|
Timelock::None => 0,
|
|
|
|
Timelock::Block(block) => (*block).try_into().unwrap(),
|
2022-07-15 05:26:07 +00:00
|
|
|
Timelock::Time(time) => *time,
|
2022-06-02 04:00:26 +00:00
|
|
|
},
|
2022-07-15 05:26:07 +00:00
|
|
|
w,
|
2022-06-02 04:00:26 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-09 22:53:52 +00:00
|
|
|
impl PartialOrd for Timelock {
|
|
|
|
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
|
|
|
match (self, other) {
|
|
|
|
(Timelock::None, _) => Some(Ordering::Less),
|
|
|
|
(Timelock::Block(a), Timelock::Block(b)) => a.partial_cmp(b),
|
|
|
|
(Timelock::Time(a), Timelock::Time(b)) => a.partial_cmp(b),
|
2022-07-15 05:26:07 +00:00
|
|
|
_ => None,
|
2022-07-09 22:53:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-22 06:34:36 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
2022-05-21 19:33:35 +00:00
|
|
|
pub struct TransactionPrefix {
|
|
|
|
pub version: u64,
|
2022-06-02 04:00:26 +00:00
|
|
|
pub timelock: Timelock,
|
2022-05-21 19:33:35 +00:00
|
|
|
pub inputs: Vec<Input>,
|
|
|
|
pub outputs: Vec<Output>,
|
2022-07-15 05:26:07 +00:00
|
|
|
pub extra: Vec<u8>,
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl TransactionPrefix {
|
2022-07-27 09:05:43 +00:00
|
|
|
pub(crate) fn fee_weight(ring_len: usize, inputs: usize, outputs: usize, extra: usize) -> usize {
|
2022-06-19 16:03:01 +00:00
|
|
|
// Assumes Timelock::None since this library won't let you create a TX with a timelock
|
|
|
|
1 + 1 +
|
2022-07-15 05:26:07 +00:00
|
|
|
varint_len(inputs) +
|
2022-07-27 09:05:43 +00:00
|
|
|
(inputs * Input::fee_weight(ring_len)) +
|
2022-07-15 05:26:07 +00:00
|
|
|
1 +
|
|
|
|
(outputs * Output::fee_weight()) +
|
|
|
|
varint_len(extra) +
|
|
|
|
extra
|
2022-06-19 16:03:01 +00:00
|
|
|
}
|
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
pub fn write<W: Write>(&self, w: &mut W) -> io::Result<()> {
|
2022-05-21 19:33:35 +00:00
|
|
|
write_varint(&self.version, w)?;
|
2023-01-07 10:18:35 +00:00
|
|
|
self.timelock.write(w)?;
|
|
|
|
write_vec(Input::write, &self.inputs, w)?;
|
|
|
|
write_vec(Output::write, &self.outputs, w)?;
|
2022-05-21 19:33:35 +00:00
|
|
|
write_varint(&self.extra.len().try_into().unwrap(), w)?;
|
|
|
|
w.write_all(&self.extra)
|
|
|
|
}
|
2022-05-22 00:27:21 +00:00
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
pub fn read<R: Read>(r: &mut R) -> io::Result<TransactionPrefix> {
|
2022-05-22 00:27:21 +00:00
|
|
|
let mut prefix = TransactionPrefix {
|
|
|
|
version: read_varint(r)?,
|
2022-06-02 04:00:26 +00:00
|
|
|
timelock: Timelock::from_raw(read_varint(r)?),
|
2023-01-07 10:18:35 +00:00
|
|
|
inputs: read_vec(Input::read, r)?,
|
|
|
|
outputs: read_vec(Output::read, r)?,
|
2022-07-15 05:26:07 +00:00
|
|
|
extra: vec![],
|
2022-05-22 00:27:21 +00:00
|
|
|
};
|
2022-08-21 08:41:55 +00:00
|
|
|
prefix.extra = read_vec(read_byte, r)?;
|
2022-05-22 00:27:21 +00:00
|
|
|
Ok(prefix)
|
|
|
|
}
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
|
2022-09-28 12:44:49 +00:00
|
|
|
/// Monero transaction. For version 1, rct_signatures still contains an accurate fee value.
|
2022-07-22 06:34:36 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
2022-05-21 19:33:35 +00:00
|
|
|
pub struct Transaction {
|
|
|
|
pub prefix: TransactionPrefix,
|
2022-09-28 09:28:42 +00:00
|
|
|
pub signatures: Vec<(Scalar, Scalar)>,
|
2022-07-15 05:26:07 +00:00
|
|
|
pub rct_signatures: RctSignatures,
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Transaction {
|
2022-08-21 14:35:10 +00:00
|
|
|
pub(crate) fn fee_weight(
|
|
|
|
protocol: Protocol,
|
|
|
|
inputs: usize,
|
|
|
|
outputs: usize,
|
|
|
|
extra: usize,
|
|
|
|
) -> usize {
|
|
|
|
TransactionPrefix::fee_weight(protocol.ring_len(), inputs, outputs, extra) +
|
|
|
|
RctSignatures::fee_weight(protocol, inputs, outputs)
|
2022-06-19 16:03:01 +00:00
|
|
|
}
|
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
pub fn write<W: Write>(&self, w: &mut W) -> io::Result<()> {
|
|
|
|
self.prefix.write(w)?;
|
2022-09-28 09:28:42 +00:00
|
|
|
if self.prefix.version == 1 {
|
|
|
|
for sig in &self.signatures {
|
|
|
|
write_scalar(&sig.0, w)?;
|
|
|
|
write_scalar(&sig.1, w)?;
|
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
} else if self.prefix.version == 2 {
|
2023-01-07 10:18:35 +00:00
|
|
|
self.rct_signatures.write(w)
|
2022-09-28 09:28:42 +00:00
|
|
|
} else {
|
|
|
|
panic!("Serializing a transaction with an unknown version");
|
|
|
|
}
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
pub fn read<R: Read>(r: &mut R) -> io::Result<Transaction> {
|
|
|
|
let prefix = TransactionPrefix::read(r)?;
|
2022-09-28 09:28:42 +00:00
|
|
|
let mut signatures = vec![];
|
|
|
|
let mut rct_signatures = RctSignatures {
|
|
|
|
base: RctBase { fee: 0, ecdh_info: vec![], commitments: vec![] },
|
|
|
|
prunable: RctPrunable::Null,
|
|
|
|
};
|
|
|
|
|
|
|
|
if prefix.version == 1 {
|
|
|
|
for _ in 0 .. prefix.inputs.len() {
|
|
|
|
signatures.push((read_scalar(r)?, read_scalar(r)?));
|
|
|
|
}
|
|
|
|
rct_signatures.base.fee = prefix
|
|
|
|
.inputs
|
|
|
|
.iter()
|
|
|
|
.map(|input| match input {
|
|
|
|
Input::Gen(..) => 0,
|
|
|
|
Input::ToKey { amount, .. } => *amount,
|
|
|
|
})
|
|
|
|
.sum::<u64>()
|
|
|
|
.saturating_sub(prefix.outputs.iter().map(|output| output.amount).sum());
|
|
|
|
} else if prefix.version == 2 {
|
2023-01-07 10:18:35 +00:00
|
|
|
rct_signatures = RctSignatures::read(
|
2022-05-22 00:27:21 +00:00
|
|
|
prefix
|
2022-07-15 05:26:07 +00:00
|
|
|
.inputs
|
|
|
|
.iter()
|
|
|
|
.map(|input| match input {
|
|
|
|
Input::Gen(_) => 0,
|
|
|
|
Input::ToKey { key_offsets, .. } => key_offsets.len(),
|
|
|
|
})
|
|
|
|
.collect(),
|
|
|
|
prefix.outputs.len(),
|
|
|
|
r,
|
2022-09-28 09:28:42 +00:00
|
|
|
)?;
|
|
|
|
} else {
|
2023-01-07 10:18:35 +00:00
|
|
|
Err(io::Error::new(io::ErrorKind::Other, "Tried to deserialize unknown version"))?;
|
2022-09-28 09:28:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Ok(Transaction { prefix, signatures, rct_signatures })
|
2022-05-22 00:27:21 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 19:33:35 +00:00
|
|
|
pub fn hash(&self) -> [u8; 32] {
|
2023-01-07 10:18:35 +00:00
|
|
|
let mut buf = Vec::with_capacity(2048);
|
2022-05-21 19:33:35 +00:00
|
|
|
if self.prefix.version == 1 {
|
2023-01-07 10:18:35 +00:00
|
|
|
self.write(&mut buf).unwrap();
|
|
|
|
hash(&buf)
|
2022-05-21 19:33:35 +00:00
|
|
|
} else {
|
2023-01-07 10:18:35 +00:00
|
|
|
let mut hashes = Vec::with_capacity(96);
|
2022-05-21 19:33:35 +00:00
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
self.prefix.write(&mut buf).unwrap();
|
|
|
|
hashes.extend(hash(&buf));
|
|
|
|
buf.clear();
|
2022-05-21 19:33:35 +00:00
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
self.rct_signatures.base.write(&mut buf, self.rct_signatures.prunable.rct_type()).unwrap();
|
|
|
|
hashes.extend(hash(&buf));
|
|
|
|
buf.clear();
|
2022-05-21 19:33:35 +00:00
|
|
|
|
2022-05-22 03:16:06 +00:00
|
|
|
match self.rct_signatures.prunable {
|
2023-01-07 10:18:35 +00:00
|
|
|
RctPrunable::Null => buf.resize(32, 0),
|
2022-05-22 03:16:06 +00:00
|
|
|
_ => {
|
2023-01-07 10:18:35 +00:00
|
|
|
self.rct_signatures.prunable.write(&mut buf).unwrap();
|
|
|
|
buf = hash(&buf).to_vec();
|
2022-05-22 03:16:06 +00:00
|
|
|
}
|
|
|
|
}
|
2023-01-07 10:18:35 +00:00
|
|
|
hashes.extend(&buf);
|
2022-05-21 19:33:35 +00:00
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
hash(&hashes)
|
2022-05-21 19:33:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-28 12:44:49 +00:00
|
|
|
/// Calculate the hash of this transaction as needed for signing it.
|
2022-05-21 19:33:35 +00:00
|
|
|
pub fn signature_hash(&self) -> [u8; 32] {
|
2023-01-07 10:18:35 +00:00
|
|
|
let mut buf = Vec::with_capacity(2048);
|
2022-05-21 19:33:35 +00:00
|
|
|
let mut sig_hash = Vec::with_capacity(96);
|
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
self.prefix.write(&mut buf).unwrap();
|
|
|
|
sig_hash.extend(hash(&buf));
|
|
|
|
buf.clear();
|
2022-05-21 19:33:35 +00:00
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
self.rct_signatures.base.write(&mut buf, self.rct_signatures.prunable.rct_type()).unwrap();
|
|
|
|
sig_hash.extend(hash(&buf));
|
|
|
|
buf.clear();
|
2022-05-21 19:33:35 +00:00
|
|
|
|
2023-01-07 10:18:35 +00:00
|
|
|
self.rct_signatures.prunable.signature_write(&mut buf).unwrap();
|
|
|
|
sig_hash.extend(hash(&buf));
|
2022-05-21 19:33:35 +00:00
|
|
|
|
|
|
|
hash(&sig_hash)
|
|
|
|
}
|
|
|
|
}
|