arnaucube
arnaucube/plonky2-crypto-gadgetsPublic Self-hosted repository
extra test to report aes-gcm circuit sizes for various params
arnaucube git@arnaucube.com
Mon, 16 Feb 2026 07:01:11 +0100
commit

8dabe88b4fd7ca88ba905823d2544f59125e0c6b

parent

44a9b0911467c0cbf27cabd794c405f1c01aea5f

1 files changed, 29 insertions(+), 5 deletions(-)

jump to
M src/circuit_gcm.rs → src/circuit_gcm.rs

@@ -561,12 +561,30 @@

#[test] fn test_encrypt() -> Result<()> { // AES-GCM-128 - test_encrypt_opt::<4, 4, 10, 13, false>()?; - test_encrypt_opt::<4, 4, 10, 13, true>()?; // with tag - test_encrypt_opt::<4, 4, 10, 17, false>()?; + test_encrypt_opt::<4, 4, 10, 13, false>(false)?; + test_encrypt_opt::<4, 4, 10, 13, true>(false)?; // with tag + test_encrypt_opt::<4, 4, 10, 17, false>(false)?; // AES-GCM-256 - test_encrypt_opt::<8, 4, 14, 13, false>()?; + test_encrypt_opt::<8, 4, 14, 13, false>(false)?; + + Ok(()) + } + // run it with: cargo test -- --ignored + #[ignore] + #[test] + fn test_encrypt_report_sizes() -> Result<()> { + // AES-GCM-128 + test_encrypt_opt::<4, 4, 10, 16, false>(true)?; + test_encrypt_opt::<4, 4, 10, 17, false>(true)?; + test_encrypt_opt::<4, 4, 10, 32, false>(true)?; + test_encrypt_opt::<4, 4, 10, 33, false>(true)?; + test_encrypt_opt::<4, 4, 10, 64, false>(true)?; + test_encrypt_opt::<4, 4, 10, 128, false>(true)?; + test_encrypt_opt::<4, 4, 10, 256, false>(true)?; + test_encrypt_opt::<4, 4, 10, 512, false>(true)?; + test_encrypt_opt::<4, 4, 10, 1024, false>(true)?; + test_encrypt_opt::<4, 4, 10, 2048, false>(true)?; Ok(()) }

@@ -576,7 +594,9 @@ const NB: usize,

const NR: usize, const L: usize, const TAG: bool, - >() -> Result<()> + >( + only_build: bool, + ) -> Result<()> where [(); 4 * (NR + 1)]:, [(); NK * NB]:,

@@ -614,6 +634,10 @@ TAG,

builder.num_gates() ); let data = builder.build::<PoseidonGoldilocksConfig>(); + + if only_build { + return Ok(()); + } // set values to circuit let mut pw = PartialWitness::<F>::new();