Skip to content

Commit

Permalink
reduce l_table_size on 32bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Mar 25, 2024
1 parent 1e92139 commit a03bc69
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ocb3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ use crate::util::{double, inplace_xor, ntz, Block};
/// needing to calculate L values at runtime.
///
/// By setting this to 32, we can process inputs of length up to 1 terabyte.
#[cfg(target_pointer_width = "64")]
const L_TABLE_SIZE: usize = 32;

/// Number of L values to be precomputed. Precomputing m values, allows
/// processing inputs of length up to 2^m blocks (2^m * 16 bytes) without
/// needing to calculate L values at runtime.
#[cfg(target_pointer_width = "32")]
const L_TABLE_SIZE: usize = 16;

/// Max associated data.
pub const A_MAX: usize = 1 << (L_TABLE_SIZE + 4);
/// Max plaintext.
Expand Down

0 comments on commit a03bc69

Please sign in to comment.