diff --git a/vendors/ocaml-tweetnacl/src/tweetnacl.ml b/vendors/ocaml-tweetnacl/src/tweetnacl.ml index 0200fc77a..2456b73c0 100644 --- a/vendors/ocaml-tweetnacl/src/tweetnacl.ml +++ b/vendors/ocaml-tweetnacl/src/tweetnacl.ml @@ -326,10 +326,10 @@ module Sign = struct begin match seed with | None -> keypair pk sk | Some buf -> - if Bigstring.length buf < seedbytes then - invalid_arg "Sign.keypair: seed must be at least 32 bytes long" ; - Bigstring.blit buf 0 sk 0 pkbytes ; - keypair_seed pk sk + if Bigstring.length buf < seedbytes then + invalid_arg "Sign.keypair: seed must be at least 32 bytes long" ; + Bigstring.blit buf 0 sk 0 pkbytes ; + keypair_seed pk sk end ; Pk pk, Sk sk diff --git a/vendors/ocaml-tweetnacl/test/test.ml b/vendors/ocaml-tweetnacl/test/test.ml index b1e72fe7d..e16539ee7 100644 --- a/vendors/ocaml-tweetnacl/test/test.ml +++ b/vendors/ocaml-tweetnacl/test/test.ml @@ -26,7 +26,7 @@ let sign () = match Sign.verify ~key:pk signed_msg with | None -> assert false | Some verified_msg -> - Alcotest.check bigstring "sign" msg verified_msg + Alcotest.check bigstring "sign" msg verified_msg let sign_detached () = let pk, sk = Sign.keypair () in @@ -42,7 +42,7 @@ let sign_extended () = match Sign.verify ~key:pk signed_msg with | None -> assert false | Some verified_msg -> - Alcotest.check bigstring "sign_extended" msg verified_msg + Alcotest.check bigstring "sign_extended" msg verified_msg let sign_extended_detached () = let pk, sk = Sign.keypair () in