upstream: https://github.com/mirage/mirage-crypto
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lint): resolve E600, E610, E615, E617 lint issues in ocaml-crypto tests

Rename test modules to match library module names (E610):
- test_base → test_uncommon, test_cipher → test_crypto
- test_ec → test_crypto_ec, test_numeric → test_crypto_pk
- test_random → random_selftests, test_ec_wycheproof → ec_wycheproof

Flatten list-type suites to single suites (E600), fix suite name
"base" → "uncommon" (E617), update test.ml runner references (E615).

+37 -26
+10 -4
tests/test.ml
··· 7 7 @@ match x with `XOR -> "XOR" | `AES -> "AES" | `GHASH -> "GHASH") 8 8 Crypto.accelerated; 9 9 Alcotest.run "crypto" 10 - ([ Test_base.suite; Test_cipher.suite ] 11 - @ Test_random.suite 12 - @ [ Test_numeric.suite; Test_dh.suite; Test_dsa.suite; Test_rsa.suite ] 13 - @ Test_ec.suite @ Test_ec_wycheproof.suite @ [ Test_entropy.suite ]) 10 + [ 11 + Test_uncommon.suite; 12 + Test_crypto.suite; 13 + Test_crypto_pk.suite; 14 + Test_dh.suite; 15 + Test_dsa.suite; 16 + Test_rsa.suite; 17 + Test_crypto_ec.suite; 18 + Test_entropy.suite; 19 + ]
+1 -1
tests/test_base.ml tests/test_uncommon.ml
··· 20 20 Alcotest.test_case (Printf.sprintf "xor %s ^ %s" a b) `Quick (fun () -> 21 21 Alcotest.(check string) "xor" (vx c) (Uncommon.xor (vx a) (vx b))) 22 22 23 - let suite = ("base", List.map xor_test xor_cases) 23 + let suite = ("uncommon", List.map xor_test xor_cases)
-4
tests/test_base.mli
··· 1 - (** Base encoding and utility tests. *) 2 - 3 - val suite : string * unit Alcotest.test_case list 4 - (** [suite] is the Alcotest test suite for base encoding operations. *)
+1
tests/test_cipher.ml tests/test_crypto.ml
··· 1102 1102 chacha20_cases; 1103 1103 [ Alcotest.test_case "poly1305" `Quick poly1305_rfc8439_2_5_2 ]; 1104 1104 [ Alcotest.test_case "empty" `Quick empty_cases ]; 1105 + List.concat_map snd Random_selftests.suite; 1105 1106 ] )
tests/test_cipher.mli tests/test_crypto.mli
+1
tests/test_crypto_ec.mli
··· 1 + val suite : string * unit Alcotest.test_case list
+19 -16
tests/test_ec.ml tests/test_crypto_ec.ml
··· 1133 1133 | Error _ -> Alcotest.fail "regression failed" 1134 1134 1135 1135 let suite = 1136 - [ 1137 - ("P256 Key exchange", key_exchange); 1138 - ("P256 Low level scalar mult", scalar_mult); 1139 - ("P256 Point validation", point_validation); 1140 - ("P256 Scalar validation when generating", scalar_validation); 1141 - ("ECDSA NIST", ecdsa); 1142 - ("ECDSA RFC 6979 P256", ecdsa_rfc6979_p256); 1143 - ("ECDSA RFC 6979 P384", ecdsa_rfc6979_p384); 1144 - ("ECDSA RFC 6979 P521", ecdsa_rfc6979_p521); 1145 - ("X25519", [ ("RFC 7748", `Quick, x25519) ]); 1146 - ("ED25519", ed25519); 1147 - ("ECDSA P521 regression", [ ("regreesion1", `Quick, p521_regression) ]); 1148 - ("P256 Point module", point_module_tests (module P256) "P256"); 1149 - ("P384 Point module", point_module_tests (module P384) "P384"); 1150 - ("P521 Point module", point_module_tests (module P521) "P521"); 1151 - ] 1136 + ( "crypto_ec", 1137 + List.concat 1138 + [ 1139 + key_exchange; 1140 + scalar_mult; 1141 + point_validation; 1142 + scalar_validation; 1143 + ecdsa; 1144 + ecdsa_rfc6979_p256; 1145 + ecdsa_rfc6979_p384; 1146 + ecdsa_rfc6979_p521; 1147 + [ ("RFC 7748", `Quick, x25519) ]; 1148 + ed25519; 1149 + [ ("regreesion1", `Quick, p521_regression) ]; 1150 + point_module_tests (module P256) "P256"; 1151 + point_module_tests (module P384) "P384"; 1152 + point_module_tests (module P521) "P521"; 1153 + List.concat_map snd Ec_wycheproof.suite; 1154 + ] )
tests/test_ec_wycheproof.ml tests/ec_wycheproof.ml
+1 -1
tests/test_numeric.ml tests/test_crypto_pk.ml
··· 5 5 let _ = int_safe_bytes 6 6 7 7 let suite = 8 - ( "numeric", 8 + ( "crypto_pk", 9 9 [ 10 10 Alcotest.test_case "z encode/decode selftest" `Quick (fun () -> 11 11 let bound = Z.(of_int64 Int64.max_int) in
tests/test_numeric.mli tests/test_crypto_pk.mli
tests/test_random.ml tests/random_selftests.ml
+4
tests/test_uncommon.mli
··· 1 + (** Uncommon utility tests. *) 2 + 3 + val suite : string * unit Alcotest.test_case list 4 + (** [suite] is the Alcotest test suite for uncommon utility operations. *)