mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-05-21 00:59:26 +00:00
Update nssa/core/src/commitment.rs
Co-authored-by: Sergio Chouhy <41742639+schouhy@users.noreply.github.com>
This commit is contained in:
parent
5dea03027a
commit
49019eaee2
@ -8,8 +8,8 @@ use crate::{NullifierPublicKey, account::Account};
|
|||||||
pub struct Commitment(pub(super) [u8; 32]);
|
pub struct Commitment(pub(super) [u8; 32]);
|
||||||
|
|
||||||
impl Commitment {
|
impl Commitment {
|
||||||
// Generates the commitment to a private account owned by user for npk:
|
/// Generates the commitment to a private account owned by user for npk:
|
||||||
// hash(npk || program_owner || balance || nonce || data)
|
/// SHA256(npk || program_owner || balance || nonce || data)
|
||||||
pub fn new(npk: &NullifierPublicKey, account: &Account) -> Self {
|
pub fn new(npk: &NullifierPublicKey, account: &Account) -> Self {
|
||||||
let mut bytes = Vec::new();
|
let mut bytes = Vec::new();
|
||||||
bytes.extend_from_slice(&npk.to_byte_array());
|
bytes.extend_from_slice(&npk.to_byte_array());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user