From ec5d61e6781907cd5b928d81c6daa6b2d20cc5e2 Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 8 Jun 2022 04:35:04 +0800 Subject: [PATCH] add comment on test --- apps/vault/libraries/crypto/src/ecdh.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/vault/libraries/crypto/src/ecdh.rs b/apps/vault/libraries/crypto/src/ecdh.rs index 7c768e44e..261b84d94 100644 --- a/apps/vault/libraries/crypto/src/ecdh.rs +++ b/apps/vault/libraries/crypto/src/ecdh.rs @@ -211,6 +211,10 @@ mod test { #[cfg(debug_assertions)] const ITERATIONS: u32 = 500; + // This test looks weird, but it's coded so I can copy-paste vectors from both a test bench and the device + // and confirm that the math is correct, and that the vectors as printed are also correct without having + // to manually check them. The test is also good in that it checks a full e2e exchange between device + // and host, as opposed to just checking againt itself. #[test] fn ecdh_test_vectors() { let host_bytes = hex::decode("555054552084aad44bc2306fc07723309c679b2b94c030fc39b23c670813da9e").unwrap();