mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 13:23:10 +00:00
fix: comments fix
This commit is contained in:
parent
d81fb2665f
commit
a11f372091
@ -1,12 +1,10 @@
|
||||
use std::io::{Cursor, Read};
|
||||
|
||||
use nssa_core::{
|
||||
Commitment, Nullifier, PrivacyPreservingCircuitOutput,
|
||||
Commitment, Nullifier,
|
||||
account::Account,
|
||||
encryption::{Ciphertext, EphemeralPublicKey},
|
||||
};
|
||||
use program_methods::PRIVACY_PRESERVING_CIRCUIT_ID;
|
||||
use risc0_zkvm::{InnerReceipt, Receipt};
|
||||
|
||||
use crate::{
|
||||
Address, PrivacyPreservingTransaction, PublicKey, Signature,
|
||||
@ -228,12 +226,6 @@ impl PrivacyPreservingTransaction {
|
||||
}
|
||||
|
||||
impl Proof {
|
||||
pub(crate) fn is_valid_for(&self, circuit_output: &PrivacyPreservingCircuitOutput) -> bool {
|
||||
let inner: InnerReceipt = borsh::from_slice(&self.0).unwrap();
|
||||
let receipt = Receipt::new(inner, circuit_output.to_bytes());
|
||||
receipt.verify(PRIVACY_PRESERVING_CIRCUIT_ID).is_ok()
|
||||
}
|
||||
|
||||
pub fn to_bytes(&self) -> Vec<u8> {
|
||||
let mut bytes = Vec::new();
|
||||
let proof_len = self.0.len() as u32;
|
||||
|
||||
@ -4,11 +4,11 @@ use nssa_core::{
|
||||
account::AccountWithMetadata,
|
||||
program::{InstructionData, ProgramOutput},
|
||||
};
|
||||
use risc0_zkvm::{ExecutorEnv, Receipt, default_prover};
|
||||
use risc0_zkvm::{ExecutorEnv, InnerReceipt, Receipt, default_prover};
|
||||
|
||||
use crate::{error::NssaError, program::Program};
|
||||
|
||||
use program_methods::PRIVACY_PRESERVING_CIRCUIT_ELF;
|
||||
use program_methods::{PRIVACY_PRESERVING_CIRCUIT_ELF, PRIVACY_PRESERVING_CIRCUIT_ID};
|
||||
|
||||
/// Proof of the privacy preserving execution circuit
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
@ -78,6 +78,14 @@ fn execute_and_prove_program(
|
||||
.receipt)
|
||||
}
|
||||
|
||||
impl Proof {
|
||||
pub(crate) fn is_valid_for(&self, circuit_output: &PrivacyPreservingCircuitOutput) -> bool {
|
||||
let inner: InnerReceipt = borsh::from_slice(&self.0).unwrap();
|
||||
let receipt = Receipt::new(inner, circuit_output.to_bytes());
|
||||
receipt.verify(PRIVACY_PRESERVING_CIRCUIT_ID).is_ok()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use nssa_core::{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user