penumbra-zone / decaf377

decaf377 is a prime-order group designed for use in SNARKs over BLS12-377
https://protocol.penumbra.zone/main/crypto/decaf377.html
12 stars 12 forks source link

ci: dedicated profile for release + debug_assert #84

Closed conorsch closed 5 months ago

conorsch commented 5 months ago

We want to use the --release behavior, but doing so directly would disable evaluation of debug_assert lines, so we'll selectively override that one option.

Updates the "check" and "test" jobs to use the --profile ci. Also ensures that "check" covers all targets, including benchmarks, and accordingly cleans up an unused import in same.

conorsch commented 5 months ago

To ensure this change does what we want, I applied this diff locally:

index c4f1f58..c25c8ef 100644
--- a/src/elligator.rs
+++ b/src/elligator.rs
@@ -52,6 +52,8 @@ impl Element {
             inner: EdwardsProjective::new(E * H, F * G, E * G, F * H),
         };

+        // Intentional panic to verify this line works in tests
+        debug_assert!(false);
         debug_assert!(
             result.inner.is_on_curve(),
             "resulting point must be on the curve",

and confirmed that:

That's good enough for me.