Skip to content

Commit

Permalink
Re-add serialized size const fn for cipher
Browse files Browse the repository at this point in the history
  • Loading branch information
vlopes11 committed Nov 4, 2020
1 parent 9dba7e1 commit 04c00bc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cipher/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use dusk_plonk::jubjub::AffinePoint;
use dusk_plonk::prelude::*;
use hades252::{ScalarStrategy, Strategy, WIDTH};

use super::{CIPHER_BYTES_SIZE, CIPHER_SIZE, MESSAGE_CAPACITY};
use super::{
CIPHER_BYTES_SIZE, CIPHER_SIZE, ENCRYPTED_DATA_SIZE, MESSAGE_CAPACITY,
};

pub use super::CipherError;

Expand Down Expand Up @@ -143,6 +145,11 @@ impl PoseidonCipher {
MESSAGE_CAPACITY
}

/// Bytes consumed on serialization of the poseidon cipher
pub const fn serialized_size() -> usize {
ENCRYPTED_DATA_SIZE
}

/// Encrypt a slice of scalars into an internal cipher representation
///
/// The message size will be truncated to [`MESSAGE_CAPACITY`] bits
Expand Down

0 comments on commit 04c00bc

Please sign in to comment.