From 2a58dd38a48edd849a54e23f5a55cc3ab34fd9d3 Mon Sep 17 00:00:00 2001 From: "Karim M. Abdellatif" Date: Mon, 8 Apr 2024 09:39:53 +0200 Subject: [PATCH] visualizing keys in hex --- examples/dpa.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/dpa.rs b/examples/dpa.rs index 9e82064..71ef30f 100644 --- a/examples/dpa.rs +++ b/examples/dpa.rs @@ -35,7 +35,7 @@ fn dpa() { dpa.update(tmp_trace, tmp_metadata); } dpa.finalize(); - println!("Guessed key = {}", dpa.pass_guess()); + println!("Guessed key = {:02x}", dpa.pass_guess()); // let corr = dpa.pass_corr_array(); } @@ -64,7 +64,7 @@ fn dpa_success() { dpa.update_success(tmp_trace, tmp_metadata); } - println!("Guessed key = {:?}", dpa.pass_guess()); + println!("Guessed key = {:02x}", dpa.pass_guess()); // let succss = dpa.pass_rank().to_owned(); } @@ -102,10 +102,11 @@ fn dpa_parallel() { .reduce(|| Dpa::new(size, guess_range, leakage_model), |x, y| x + y); dpa.finalize(); - println!("{:?}", dpa.pass_guess()); + println!("{:2x}", dpa.pass_guess()); // let corr = dpa.pass_corr_array(); } + fn main() { dpa(); }