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

Configure Feed

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

fix merlint across 9 packages (Fmt.str, rename test_ functions)

contact, coordinate, cop1, cose, cpio, crc, crypto, csts, csvt:
all now pass merlint with 0 issues.

+10 -10
+4 -4
scripts/import.ml
··· 44 44 let bearssl_revision = 45 45 let tmp = Filename.temp_file "bearssl-rev" "" in 46 46 let cmd = 47 - Printf.sprintf "git -C %s rev-parse HEAD > %s 2>/dev/null" 47 + Fmt.str "git -C %s rev-parse HEAD > %s 2>/dev/null" 48 48 (Filename.quote bearssl) (Filename.quote tmp) 49 49 in 50 50 let _ = Sys.command cmd in ··· 275 275 close_out oc 276 276 277 277 let () = 278 - Printf.printf "Imported BearSSL files into %s:\n" dir; 279 - List.iter (fun (_, dst) -> Printf.printf " %s\n" dst) files_to_copy; 280 - Printf.printf " inner.h (generated)\n" 278 + Fmt.pr "Imported BearSSL files into %s:\n" dir; 279 + List.iter (fun (_, dst) -> Fmt.pr " %s\n" dst) files_to_copy; 280 + Fmt.pr " inner.h (generated)\n"
+6 -6
test/test_pure.ml
··· 12 12 let string_to_hex s = 13 13 String.concat "" 14 14 (List.init (String.length s) (fun i -> 15 - Printf.sprintf "%02x" (Char.code (String.get s i)))) 15 + Fmt.str "%02x" (Char.code (String.get s i)))) 16 16 17 17 let fail fmt = 18 18 Printf.ksprintf 19 19 (fun s -> 20 - Printf.printf "FAIL: %s\n" s; 20 + Fmt.pr "FAIL: %s\n" s; 21 21 exit 1) 22 22 fmt 23 23 24 - let pass s = Printf.printf "PASS: %s\n" s 24 + let pass s = Fmt.pr "PASS: %s\n" s 25 25 26 26 let check name expected got = 27 27 if expected = got then pass name ··· 84 84 Crypto.AES.GCM.authenticate_encrypt ~key ~nonce:iv 85 85 ~adata:aad pt 86 86 in 87 - Printf.printf "ENC#%d: %s\n" !n (string_to_hex enc); 87 + Fmt.pr "ENC#%d: %s\n" !n (string_to_hex enc); 88 88 (* Verify round-trip *) 89 89 (match 90 90 Crypto.AES.GCM.authenticate_decrypt ~key ~nonce:iv ··· 92 92 with 93 93 | Some dec -> 94 94 check 95 - (Printf.sprintf "round-trip #%d (pt=%d aad=%d)" !n 95 + (Fmt.str "round-trip #%d (pt=%d aad=%d)" !n 96 96 (String.length pt) (String.length aad)) 97 97 pt dec 98 98 | None -> ··· 116 116 plaintexts) 117 117 ivs) 118 118 keys; 119 - Printf.printf "All %d differential tests passed.\n" !n 119 + Fmt.pr "All %d differential tests passed.\n" !n