From 5b4d6c1932d6f8c6a2cf4ab1f7d14266d2039376 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 2 Dec 2025 01:05:26 +0800 Subject: [PATCH] add benchmark data on chaffing unchaffed AES is 5.36us/block chaffed AES is 10.27us/block so ~2x overhead for chaffing - about what we expect for the implementation. --- services/bao-console/Cargo.toml | 6 ++++-- services/bao-console/src/cmds/aes_cmd.rs | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/services/bao-console/Cargo.toml b/services/bao-console/Cargo.toml index cf0a3ac65..e1c2f7ae6 100644 --- a/services/bao-console/Cargo.toml +++ b/services/bao-console/Cargo.toml @@ -30,7 +30,9 @@ rand = { version = "0.8.5", features = ["getrandom"], optional = true } rand_chacha = { version = "0.3.1", optional = true } rand_core = "0.6.4" -aes = { path = "../aes", default-features = false, optional = true } +aes = { path = "../aes", default-features = false, optional = true, features = [ + "chaffing", +] } # time testing chrono = "0.4.33" @@ -82,4 +84,4 @@ rramtests = [] # loaded and run. duart-debug-hal = ["bao1x-hal/debug-print-duart"] -default = ["with-pddb"] +default = ["with-pddb", "aestests"] diff --git a/services/bao-console/src/cmds/aes_cmd.rs b/services/bao-console/src/cmds/aes_cmd.rs index f584372f4..84a1377c9 100644 --- a/services/bao-console/src/cmds/aes_cmd.rs +++ b/services/bao-console/src/cmds/aes_cmd.rs @@ -168,6 +168,10 @@ with vex bao1x CPU (400MHz) hardware 4.65µs/block enc+dec AES256 software 45.79µs/block enc+dec AES256 +with vex bao1x CPU (350MHz) +hardware 5.36µs/block enc+dec AES256 +software 52.45µs/block enc+dec AES256 +hardware - with chaffing - 10.27µs/block enc+dec AES256 */ pub fn benchmark_thread(sid0: usize, sid1: usize, sid2: usize, sid3: usize) { let sid = xous::SID::from_u32(sid0 as u32, sid1 as u32, sid2 as u32, sid3 as u32);