upstream: https://github.com/mirage/mirage-crypto
at main 111 lines 2.5 kB view raw
1type json 2type hex = string 3 4val equal_hex : hex -> hex -> bool 5val pp_hex : Format.formatter -> hex -> unit 6 7type test_result = Valid | Acceptable | Invalid 8 9val pp_test_result : Format.formatter -> test_result -> unit 10val show_test_result : test_result -> string 11 12type ecdh_test = { 13 tcId : int; 14 comment : string; 15 curve : json option; 16 public : hex; 17 private_ : hex; 18 shared : hex; 19 result : test_result; 20 flags : string list; 21} 22 23val pp_ecdh_test : Format.formatter -> ecdh_test -> unit 24val show_ecdh_test : ecdh_test -> string 25val has_ignored_flag : ecdh_test -> ignored_flags:string list -> bool 26 27type ecdh_test_group = { 28 curve : string; 29 tests : ecdh_test list; 30 encoding : json option; 31 type_ : json option; 32} 33 34val pp_ecdh_test_group : Format.formatter -> ecdh_test_group -> unit 35val show_ecdh_test_group : ecdh_test_group -> string 36 37type ecdsa_key = { 38 curve : string; 39 keySize : int; 40 type_ : json; 41 uncompressed : hex; 42 wx : hex; 43 wy : hex; 44} 45 46val pp_ecdsa_key : Format.formatter -> ecdsa_key -> unit 47val show_ecdsa_key : ecdsa_key -> string 48 49type dsa_test = { 50 tcId : int; 51 comment : string; 52 msg : hex; 53 sig_ : hex; 54 result : test_result; 55 flags : string list; 56} 57 58val pp_dsa_test : Format.formatter -> dsa_test -> unit 59val show_dsa_test : dsa_test -> string 60 61type ecdsa_test_group = { 62 key : ecdsa_key; 63 keyDer : string; 64 keyPem : string; 65 sha : string; 66 tests : dsa_test list; 67 type_ : json option; 68} 69 70val pp_ecdsa_test_group : Format.formatter -> ecdsa_test_group -> unit 71val show_ecdsa_test_group : ecdsa_test_group -> string 72 73type eddsa_key = { 74 curve : string; 75 keySize : int; 76 pk : hex; 77 sk : hex; 78 type_ : json; 79} 80 81val pp_eddsa_key : Format.formatter -> eddsa_key -> unit 82val show_eddsa_key : eddsa_key -> string 83 84type eddsa_test_group = { 85 jwk : json; 86 key : eddsa_key; 87 keyDer : string; 88 keyPem : string; 89 type_ : json; 90 tests : dsa_test list; 91} 92 93val pp_eddsa_test_group : Format.formatter -> eddsa_test_group -> unit 94val show_eddsa_test_group : eddsa_test_group -> string 95 96type test_file = { 97 algorithm : json; 98 generatorVersion : json; 99 header : json; 100 notes : json; 101 numberOfTests : json; 102 schema : json; 103 testGroups : json list; 104} 105 106val pp_test_file : Format.formatter -> test_file -> unit 107val show_test_file : test_file -> string 108val load_file_exn : string -> test_file 109val ecdh_test_group_exn : json -> ecdh_test_group 110val ecdsa_test_group_exn : json -> ecdsa_test_group 111val eddsa_test_group_exn : json -> eddsa_test_group