From 259a2512d95cbb828a540851475d3a7306b47ba6 Mon Sep 17 00:00:00 2001 From: Tom French Date: Sat, 30 Nov 2024 20:14:57 +0000 Subject: [PATCH] chore: add benchmarks --- src/lib.nr | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/lib.nr b/src/lib.nr index a2b4093..b4c25d4 100644 --- a/src/lib.nr +++ b/src/lib.nr @@ -149,3 +149,26 @@ mod test { } } + +mod bench { + use super::{assert_valid_signature, verify_signature}; + use std::embedded_curve_ops::EmbeddedCurvePoint; + + #[export] + pub fn bench_verify_signature( + public_key: EmbeddedCurvePoint, + signature: [u8; 64], + message: [u8; 32], + ) -> bool { + verify_signature(public_key, signature, message) + } + + #[export] + pub fn bench_assert_valid_signature( + public_key: EmbeddedCurvePoint, + signature: [u8; 64], + message: [u8; 32], + ) { + assert_valid_signature(public_key, signature, message) + } +}