1package(default_visibility = ["//visibility:public"]) 2 3licenses(["notice"]) 4 5filegroup( 6 name = "hpke_boringssl", 7 testonly = 1, 8 srcs = ["hpke_boringssl.json"], 9) 10 11# Below we define a set of genrules to copy test vectors from Wycheproof. 12# This is needed to assist the transition to using Bazel Modules, in that Bazel 13# Modules packages use a different folder naming for dependencies compared to 14# WORKSPACE-based packages. 15 16genrule( 17 name = "aes_cmac", 18 testonly = 1, 19 srcs = ["@wycheproof//testvectors:aes_cmac"], 20 outs = ["aes_cmac_test.json"], 21 cmd = "cp $(SRCS) $(@D)/", 22) 23 24genrule( 25 name = "aes_gcm", 26 testonly = 1, 27 srcs = ["@wycheproof//testvectors:aes_gcm"], 28 outs = ["aes_gcm_test.json"], 29 cmd = "cp $(SRCS) $(@D)/", 30) 31 32genrule( 33 name = "aes_gcm_siv", 34 testonly = 1, 35 srcs = ["@wycheproof//testvectors:aes_gcm_siv"], 36 outs = ["aes_gcm_siv_test.json"], 37 cmd = "cp $(SRCS) $(@D)/", 38) 39 40genrule( 41 name = "aes_eax", 42 testonly = 1, 43 srcs = ["@wycheproof//testvectors:aes_eax"], 44 outs = ["aes_eax_test.json"], 45 cmd = "cp $(SRCS) $(@D)/", 46) 47 48genrule( 49 name = "aes_siv_cmac", 50 testonly = 1, 51 srcs = ["@wycheproof//testvectors:aes_siv_cmac"], 52 outs = [ 53 "aead_aes_siv_cmac_test.json", 54 "aes_siv_cmac_test.json", 55 ], 56 cmd = "cp $(SRCS) $(@D)/", 57) 58 59genrule( 60 name = "chacha20_poly1305", 61 testonly = 1, 62 srcs = ["@wycheproof//testvectors:chacha20_poly1305"], 63 outs = [ 64 "chacha20_poly1305_test.json", 65 "xchacha20_poly1305_test.json", 66 ], 67 cmd = "cp $(SRCS) $(@D)/", 68) 69 70genrule( 71 name = "hmac", 72 testonly = 1, 73 srcs = ["@wycheproof//testvectors:hmac"], 74 outs = [ 75 "hmac_sha1_test.json", 76 "hmac_sha224_test.json", 77 "hmac_sha256_test.json", 78 "hmac_sha384_test.json", 79 "hmac_sha3_224_test.json", 80 "hmac_sha3_256_test.json", 81 "hmac_sha3_384_test.json", 82 "hmac_sha3_512_test.json", 83 "hmac_sha512_test.json", 84 ], 85 cmd = "cp $(SRCS) $(@D)/", 86) 87 88genrule( 89 name = "rsa_pss", 90 testonly = 1, 91 srcs = ["@wycheproof//testvectors:all"], 92 outs = [ 93 "rsa_pss_2048_sha1_mgf1_20_test.json", 94 "rsa_pss_2048_sha256_mgf1_0_test.json", 95 "rsa_pss_2048_sha256_mgf1_32_test.json", 96 "rsa_pss_2048_sha512_256_mgf1_28_test.json", 97 "rsa_pss_2048_sha512_256_mgf1_32_test.json", 98 "rsa_pss_3072_sha256_mgf1_32_test.json", 99 "rsa_pss_4096_sha256_mgf1_32_test.json", 100 "rsa_pss_4096_sha512_mgf1_32_test.json", 101 "rsa_pss_misc_test.json", 102 ], 103 cmd = "cp $(SRCS) $(@D)/", 104) 105 106genrule( 107 name = "rsa_signature", 108 testonly = 1, 109 srcs = ["@wycheproof//testvectors:rsa_signature"], 110 outs = [ 111 # Signature verification 112 "rsa_signature_2048_sha224_test.json", 113 "rsa_signature_2048_sha256_test.json", 114 "rsa_signature_2048_sha512_test.json", 115 "rsa_signature_3072_sha256_test.json", 116 "rsa_signature_3072_sha384_test.json", 117 "rsa_signature_3072_sha512_test.json", 118 "rsa_signature_4096_sha384_test.json", 119 "rsa_signature_4096_sha512_test.json", 120 "rsa_signature_2048_sha3_224_test.json", 121 "rsa_signature_2048_sha3_256_test.json", 122 "rsa_signature_2048_sha3_384_test.json", 123 "rsa_signature_2048_sha3_512_test.json", 124 "rsa_signature_3072_sha3_256_test.json", 125 "rsa_signature_3072_sha3_384_test.json", 126 "rsa_signature_3072_sha3_512_test.json", 127 "rsa_signature_test.json", 128 # Signature generation 129 "rsa_sig_gen_misc_test.json", 130 ], 131 cmd = "cp $(SRCS) $(@D)/", 132) 133 134genrule( 135 name = "ecdsa_webcrypto", 136 testonly = 1, 137 srcs = ["@wycheproof//testvectors:ecdsa_webcrypto"], 138 outs = ["ecdsa_webcrypto_test.json"], 139 cmd = "cp $(SRCS) $(@D)/", 140) 141 142genrule( 143 name = "ecdsa", 144 testonly = 1, 145 srcs = ["@wycheproof//testvectors:all"], 146 outs = [ 147 "ecdsa_brainpoolP224r1_sha224_test.json", 148 "ecdsa_brainpoolP256r1_sha256_test.json", 149 "ecdsa_brainpoolP320r1_sha384_test.json", 150 "ecdsa_brainpoolP384r1_sha384_test.json", 151 "ecdsa_brainpoolP512r1_sha512_test.json", 152 "ecdsa_secp224r1_sha224_test.json", 153 "ecdsa_secp224r1_sha256_test.json", 154 "ecdsa_secp224r1_sha3_224_test.json", 155 "ecdsa_secp224r1_sha3_256_test.json", 156 "ecdsa_secp224r1_sha3_512_test.json", 157 "ecdsa_secp224r1_sha512_test.json", 158 "ecdsa_secp256k1_sha256_test.json", 159 "ecdsa_secp256k1_sha3_256_test.json", 160 "ecdsa_secp256k1_sha3_512_test.json", 161 "ecdsa_secp256k1_sha512_test.json", 162 "ecdsa_secp256r1_sha256_test.json", 163 "ecdsa_secp256r1_sha3_256_test.json", 164 "ecdsa_secp256r1_sha3_512_test.json", 165 "ecdsa_secp256r1_sha512_test.json", 166 "ecdsa_secp384r1_sha384_test.json", 167 "ecdsa_secp384r1_sha3_384_test.json", 168 "ecdsa_secp384r1_sha3_512_test.json", 169 "ecdsa_secp384r1_sha512_test.json", 170 "ecdsa_secp521r1_sha3_512_test.json", 171 "ecdsa_secp521r1_sha512_test.json", 172 "ecdsa_secp256r1_sha256_p1363_test.json", 173 "ecdsa_secp384r1_sha512_p1363_test.json", 174 "ecdsa_secp521r1_sha512_p1363_test.json", 175 "ecdsa_test.json", # deprecated: use the files above 176 ], 177 cmd = "cp $(SRCS) $(@D)/", 178) 179 180genrule( 181 name = "eddsa", 182 testonly = 1, 183 srcs = ["@wycheproof//testvectors:eddsa"], 184 outs = [ 185 "ed448_test.json", 186 "eddsa_test.json", 187 ], 188 cmd = "cp $(SRCS) $(@D)/", 189) 190 191genrule( 192 name = "ecdh", 193 testonly = 1, 194 srcs = ["@wycheproof//testvectors:ecdh"], 195 outs = [ 196 "ecdh_brainpoolP224r1_test.json", 197 "ecdh_brainpoolP256r1_test.json", 198 "ecdh_brainpoolP320r1_test.json", 199 "ecdh_brainpoolP384r1_test.json", 200 "ecdh_brainpoolP512r1_test.json", 201 "ecdh_secp224r1_test.json", 202 "ecdh_secp256k1_test.json", 203 "ecdh_secp256r1_test.json", 204 "ecdh_secp384r1_test.json", 205 "ecdh_secp521r1_test.json", 206 "ecdh_test.json", # deprecated use the files above 207 ], 208 cmd = "cp $(SRCS) $(@D)/", 209) 210 211genrule( 212 name = "ecdh_ecpoint", 213 testonly = 1, 214 srcs = ["@wycheproof//testvectors:ecdh_ecpoint"], 215 outs = [ 216 "ecdh_secp224r1_ecpoint_test.json", 217 "ecdh_secp256r1_ecpoint_test.json", 218 "ecdh_secp384r1_ecpoint_test.json", 219 "ecdh_secp521r1_ecpoint_test.json", 220 ], 221 cmd = "cp $(SRCS) $(@D)/", 222) 223 224genrule( 225 name = "keywrap", 226 testonly = 1, 227 srcs = ["@wycheproof//testvectors:keywrap"], 228 outs = [ 229 "kw_test.json", 230 "kwp_test.json", 231 ], 232 cmd = "cp $(SRCS) $(@D)/", 233) 234 235genrule( 236 name = "kdf", 237 testonly = 1, 238 srcs = ["@wycheproof//testvectors:kdf"], 239 outs = [ 240 "hkdf_sha1_test.json", 241 "hkdf_sha256_test.json", 242 "hkdf_sha384_test.json", 243 "hkdf_sha512_test.json", 244 ], 245 cmd = "cp $(SRCS) $(@D)/", 246) 247 248genrule( 249 name = "xdh", 250 testonly = 1, 251 srcs = ["@wycheproof//testvectors:xdh"], 252 outs = [ 253 "x25519_asn_test.json", 254 "x25519_jwk_test.json", 255 "x25519_pem_test.json", 256 "x25519_test.json", 257 "x448_asn_test.json", 258 "x448_jwk_test.json", 259 "x448_pem_test.json", 260 "x448_test.json", 261 ], 262 cmd = "cp $(SRCS) $(@D)/", 263) 264