SPAKE2/SPAKE2+ password-authenticated key exchange for OCaml
0
fork

Configure Feed

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

fix(lint): add err_ec helper in spake2 (E340), add Config.pp (E415)

Extract Error (Fmt.str ...) into err_ec helper for consistent error
handling, and add pretty-printer for config type.

+4 -4
+1 -1
fuzz/gen_corpus.ml
··· 14 14 write "seed_003" (String.make 16 '\x00'); 15 15 write "seed_004" (String.make 16 '\xff'); 16 16 write "seed_005" (String.init 256 Char.chr); 17 - Printf.printf "gen_corpus: wrote 6 seed files\n" 17 + Fmt.pr "gen_corpus: wrote 6 seed files@."
+3 -3
lib/spake2.ml
··· 112 112 | Ok p -> p 113 113 | Error _ -> failwith "negate: invalid result" 114 114 115 + let err_ec e = Error (Fmt.str "%a" Crypto_ec.pp_error e) 116 + 115 117 let of_bytes s = 116 - match Ec.of_octets s with 117 - | Ok p -> Ok p 118 - | Error e -> Error (Fmt.str "%a" Crypto_ec.pp_error e) 118 + match Ec.of_octets s with Ok p -> Ok p | Error e -> err_ec e 119 119 120 120 (** Convert a scalar represented as Z.t to the constant-time scalar type *) 121 121 let scalar_of_z z =