From 7fac43227f14e93259a8a8069d31af0a2d30b314 Mon Sep 17 00:00:00 2001 From: PatStiles Date: Wed, 22 Nov 2023 16:36:01 -0600 Subject: [PATCH] fix cmts --- .../fuzz_targets/curve_bls12_381.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fuzz/no_gpu_fuzz/fuzz_targets/curve_bls12_381.rs b/fuzz/no_gpu_fuzz/fuzz_targets/curve_bls12_381.rs index b98eb4f8d..b5f281463 100644 --- a/fuzz/no_gpu_fuzz/fuzz_targets/curve_bls12_381.rs +++ b/fuzz/no_gpu_fuzz/fuzz_targets/curve_bls12_381.rs @@ -22,8 +22,8 @@ use lambdaworks_math::{ type LambdaG1 = ShortWeierstrassProjectivePoint; type LambdaG2 = ShortWeierstrassProjectivePoint; -//TODO: derive arbitrary for Affine and Projective or change this to use &[u8] as input to cover more cases. -//TODO: use more advanced options to generate values over curve specifically given most inputs will fail curve check. +//TODO: Derive arbitrary for Affine and Projective or change this to use &[u8] as input to cover more cases. +//TODO: Use more advanced options to generate values over curve specifically given most inputs will fail curve check. //TODO: Investigate normalization of projective coordinates in arkworks to allow for differential fuzzing. fuzz_target!(|values: (u64, u64)| { let (a_val, b_val) = values; @@ -43,18 +43,18 @@ fuzz_target!(|values: (u64, u64)| { // -O = O assert_eq!(g1_zero.neg(), g1_zero, "Neutral mul element a failed"); - // P * O = O + // P + O = O assert_eq!(a_g1.operate_with(&g1_zero), a_g1, "Neutral operate_with element a failed"); assert_eq!(b_g1.operate_with(&g1_zero), b_g1, "Neutral operate_with element b failed"); - // P * Q = Q * P + // P + Q = Q + P assert_eq!(a_g1.operate_with(&b_g1), b_g1.operate_with(&a_g1), "Commutative add property failed"); - // (P * Q) * R = Q * (P * R) + // (P + Q) + R = Q + (P + R) let c_g1 = a_g1.operate_with(&b_g1); assert_eq!((a_g1.operate_with(&b_g1)).operate_with(&c_g1), a_g1.operate_with(&b_g1.operate_with(&c_g1)), "Associative operate_with property failed"); - // P * -P = O + // P + -P = O assert_eq!(a_g1.operate_with(&a_g1.neg()), g1_zero, "Inverse add a failed"); assert_eq!(b_g1.operate_with(&b_g1.neg()), g1_zero, "Inverse add b failed"); @@ -62,18 +62,18 @@ fuzz_target!(|values: (u64, u64)| { // -O = O assert_eq!(g2_zero.neg(), g2_zero, "Neutral mul element a failed"); - // P * O = O + // P + O = O assert_eq!(a_g2.operate_with(&g2_zero), a_g2, "Neutral operate_with element a failed"); assert_eq!(b_g2.operate_with(&g2_zero), b_g2, "Neutral operate_with element b failed"); - // P * Q = Q * P + // P + Q = Q + P assert_eq!(a_g2.operate_with(&b_g2), b_g2.operate_with(&a_g2), "Commutative add property failed"); - // (P * Q) * R = Q * (P * R) + // (P + Q) + R = Q + (P + R) let c_g2 = a_g2.operate_with(&b_g2); assert_eq!((a_g2.operate_with(&b_g2)).operate_with(&c_g2), a_g2.operate_with(&b_g2.operate_with(&c_g2)), "Associative operate_with property failed"); - // P * -P = O + // P + -P = O assert_eq!(a_g2.operate_with(&a_g2.neg()), g2_zero, "Inverse add a failed"); assert_eq!(b_g2.operate_with(&b_g2.neg()), g2_zero, "Inverse add b failed");