Skip to content

Commit

Permalink
Smaller numbers for smaller SSA
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Jan 8, 2025
1 parent f8983e8 commit 239f694
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
// The issue was around `encrypted_bytes[offset + i]` generating large amounts of gates, as per the `flamegraph.sh` tool in aztec-packages.
// The details around encryption and addresses have been stripped away, focusing on just copying bytes of equivalent size arrays.

global PRIVATE_LOG_SIZE_IN_FIELDS: u32 = 18;
global ENCRYPTED_PAYLOAD_SIZE_IN_BYTES: u32 = (PRIVATE_LOG_SIZE_IN_FIELDS - 1) * 31;
global EPH_PK_SIZE: u32 = 32;
global HEADER_SIZE: u32 = 48;
global OVERHEAD_PADDING: u32 = 15;
// Using the same formulas with smaller numbers; the effect is the same, but the SSA is more manageable.
global PRIVATE_LOG_SIZE_IN_FIELDS: u32 = 4; // Originally 18
global ENCRYPTED_PAYLOAD_SIZE_IN_BYTES: u32 = (PRIVATE_LOG_SIZE_IN_FIELDS - 1) * 5; // Originally 31
global EPH_PK_SIZE: u32 = 3; // Originally 32
global HEADER_SIZE: u32 = 2; // Originally 48
global OVERHEAD_PADDING: u32 = 1; // Originally 15
// global OVERHEAD_SIZE: u32 = EPH_PK_SIZE + HEADER_SIZE + OVERHEAD_PADDING;
// global PLAINTEXT_LENGTH_SIZE: u32 = 2;
// global MAX_PRIVATE_LOG_PLAINTEXT_SIZE_IN_BYTES: u32 =
Expand Down

0 comments on commit 239f694

Please sign in to comment.