| /src/sbin/md5/tests/ |
| H A D | md5_test.sh | 178 for alg in $algorithms ; do 180 atf_test_case self_test_${alg} 181 self_test_${alg}_head() { 182 atf_set descr \"self-test for \$name_bsd_${alg}\" 183 atf_set require.progs \"${alg}\" 185 self_test_${alg}_body() { 186 atf_check -o ignore ${alg} --self-test 191 atf_test_case bsd_${alg}_vec${i} 192 bsd_${alg}_vec${i}_head() { 193 atf_set descr \"BSD mode \$name_bsd_${alg} test vector ${i}\" [all …]
|
| /src/crypto/openssl/test/recipes/ |
| H A D | 15-test_ml_dsa_codecs.t | 33 my %alg = ("44" => [4, 4, 2560], "65" => [6, 5, 4032], "87" => [8, 7, 4896]); 35 foreach my $alg (@algs) { 36 my $pub = sprintf("pub-%s.pem", $alg); 37 my %formats = map { ($_, sprintf("prv-%s-%s.pem", $alg, $_)) } @formats; 38 my ($k, $l, $sk_len) = @{$alg{$alg}}; 45 my $der0 = sprintf("pub-%s.%d.der", $alg, $i++); 54 my $der = sprintf("pub-%s.%d.der", $alg, $i); 60 sprintf("pubkey DER match: %s, %s", $alg, $f)); 63 my $pem = sprintf("prv-%s-%s.%d.pem", $alg, $f, $i++); 65 '-pkeyopt', "hexseed:$seed", '-algorithm', "ml-dsa-$alg", [all …]
|
| H A D | 15-test_ml_kem_codecs.t | 34 foreach my $alg (@algs) { 35 my $pub = sprintf("pub-%s.pem", $alg); 36 my %formats = map { ($_, sprintf("prv-%s-%s.pem", $alg, $_)) } @formats; 41 my $der0 = sprintf("pub-%s.%d.der", $alg, $i++); 50 my $der = sprintf("pub-%s.%d.der", $alg, $i); 56 sprintf("pubkey DER match: %s, %s", $alg, $f)); 59 my $pem = sprintf("prv-%s-%s.%d.pem", $alg, $f, $i++); 61 '-pkeyopt', "hexseed:$seed", '-algorithm', "ml-kem-$alg", 64 sprintf("prvkey PEM match: %s, %s", $alg, $f)); 75 my $refct = sprintf("ct-%s.dat", $alg); [all …]
|
| /src/crypto/openssh/ |
| H A D | digest-libc.c | 58 int alg; member 128 ssh_digest_by_alg(int alg) in ssh_digest_by_alg() argument 130 if (alg < 0 || alg >= SSH_DIGEST_MAX) in ssh_digest_by_alg() 132 if (digests[alg].id != alg) /* sanity */ in ssh_digest_by_alg() 134 return &(digests[alg]); in ssh_digest_by_alg() 140 int alg; in ssh_digest_alg_by_name() local 142 for (alg = 0; alg < SSH_DIGEST_MAX; alg++) { in ssh_digest_alg_by_name() 143 if (strcasecmp(name, digests[alg].name) == 0) in ssh_digest_alg_by_name() 144 return digests[alg].id; in ssh_digest_alg_by_name() 150 ssh_digest_alg_name(int alg) in ssh_digest_alg_name() argument [all …]
|
| H A D | digest-openssl.c | 46 int alg; member 68 ssh_digest_by_alg(int alg) in ssh_digest_by_alg() argument 70 if (alg < 0 || alg >= SSH_DIGEST_MAX) in ssh_digest_by_alg() 72 if (digests[alg].id != alg) /* sanity */ in ssh_digest_by_alg() 74 if (digests[alg].mdfunc == NULL) in ssh_digest_by_alg() 76 return &(digests[alg]); in ssh_digest_by_alg() 82 int alg; in ssh_digest_alg_by_name() local 84 for (alg = 0; digests[alg].id != -1; alg++) { in ssh_digest_alg_by_name() 85 if (strcasecmp(name, digests[alg].name) == 0) in ssh_digest_alg_by_name() 86 return digests[alg].id; in ssh_digest_alg_by_name() [all …]
|
| /src/tools/tools/crypto/ |
| H A D | cryptocheck.c | 164 static const struct alg { struct 275 static const struct alg * 286 static struct alg * 287 build_eta(const struct alg *cipher, const struct alg *mac) in build_eta() 289 struct alg *eta; in build_eta() 306 free_eta(struct alg *eta) in free_eta() 312 static struct alg * 315 const struct alg *cipher, *mac; in build_eta_name() 433 generate_iv(size_t len, const struct alg *alg) in generate_iv() argument 438 switch (alg->cipher) { in generate_iv() [all …]
|
| /src/crypto/openssl/crypto/property/ |
| H A D | property.c | 110 ALGORITHM *alg); 219 static void impl_cache_flush_alg(ossl_uintmax_t idx, ALGORITHM *alg) in impl_cache_flush_alg() argument 221 lh_QUERY_doall(alg->cache, &impl_cache_free); in impl_cache_flush_alg() 222 lh_QUERY_flush(alg->cache); in impl_cache_flush_alg() 287 static int ossl_method_store_insert(OSSL_METHOD_STORE *store, ALGORITHM *alg) in ossl_method_store_insert() argument 289 return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg); in ossl_method_store_insert() 322 ALGORITHM *alg = NULL; in ossl_method_store_add() local 388 alg = ossl_method_store_retrieve(store, nid); in ossl_method_store_add() 389 if (alg == NULL) { in ossl_method_store_add() 390 if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL in ossl_method_store_add() [all …]
|
| /src/crypto/openssl/crypto/asn1/ |
| H A D | x_algor.c | 30 int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) 32 if (alg == NULL) 35 if (ptype != V_ASN1_UNDEF && alg->parameter == NULL 36 && (alg->parameter = ASN1_TYPE_new()) == NULL) 39 ASN1_OBJECT_free(alg->algorithm); 40 alg->algorithm = aobj; 45 ASN1_TYPE_free(alg->parameter); 46 alg->parameter = NULL; 48 ASN1_TYPE_set(alg->parameter, ptype, pval); 55 X509_ALGOR *alg = NULL; in ossl_X509_ALGOR_from_nid() local [all …]
|
| H A D | p5_pbe.c | 28 int PKCS5_pbe_set0_algor_ex(X509_ALGOR *algor, int alg, int iter, 72 if (X509_ALGOR_set0(algor, OBJ_nid2obj(alg), V_ASN1_SEQUENCE, pbe_str)) 82 int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, in PKCS5_pbe_set0_algor() argument 85 return PKCS5_pbe_set0_algor_ex(algor, alg, iter, salt, saltlen, NULL); in PKCS5_pbe_set0_algor() 90 X509_ALGOR *PKCS5_pbe_set_ex(int alg, int iter, in PKCS5_pbe_set_ex() argument 101 if (PKCS5_pbe_set0_algor_ex(ret, alg, iter, salt, saltlen, ctx)) in PKCS5_pbe_set_ex() 108 X509_ALGOR *PKCS5_pbe_set(int alg, int iter, in PKCS5_pbe_set() argument 111 return PKCS5_pbe_set_ex(alg, iter, salt, saltlen, NULL); in PKCS5_pbe_set()
|
| /src/crypto/openssl/ssl/ |
| H A D | ssl_cert_comp.c | 16 size_t ossl_calculate_comp_expansion(int alg, size_t length) in ossl_calculate_comp_expansion() argument 26 switch (alg) { in ossl_calculate_comp_expansion() 61 static OSSL_COMP_CERT *OSSL_COMP_CERT_new(unsigned char *data, size_t len, size_t orig_len, int alg) in OSSL_COMP_CERT_new() argument 65 if (!ossl_comp_has_alg(alg) in OSSL_COMP_CERT_new() 74 ret->alg = alg; in OSSL_COMP_CERT_new() 84 size_t orig_len, int alg) in OSSL_COMP_CERT_from_compressed_data() argument 86 return OSSL_COMP_CERT_new(OPENSSL_memdup(data, len), len, orig_len, alg); in OSSL_COMP_CERT_from_compressed_data() 90 int alg) in OSSL_COMP_CERT_from_uncompressed_data() argument 99 switch (alg) { in OSSL_COMP_CERT_from_uncompressed_data() 113 if ((max_length = ossl_calculate_comp_expansion(alg, len)) == 0 in OSSL_COMP_CERT_from_uncompressed_data() [all …]
|
| /src/crypto/openssl/providers/implementations/ciphers/ |
| H A D | cipher_cts.h | 13 #define IMPLEMENT_cts_cipher(alg, UCALG, lcmode, UCMODE, flags, kbits, \ argument 15 static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_##lcmode##_get_params; \ 16 static int alg##_cts_##kbits##_##lcmode##_get_params(OSSL_PARAM params[]) \ 21 const OSSL_DISPATCH ossl_##alg##kbits##lcmode##_cts_functions[] = { \ 23 (void (*)(void))alg##_##kbits##_##lcmode##_newctx }, \ 24 { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void))alg##_freectx }, \ 25 { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void))alg##_dupctx }, \ 26 { OSSL_FUNC_CIPHER_ENCRYPT_INIT, (void (*)(void))alg##_cbc_cts_einit }, \ 27 { OSSL_FUNC_CIPHER_DECRYPT_INIT, (void (*)(void))alg##_cbc_cts_dinit }, \ 34 (void (*)(void))alg##_cts_##kbits##_##lcmode##_get_params }, \ [all …]
|
| H A D | cipher_aes_gcm_siv.c | 273 #define IMPLEMENT_cipher(alg, lc, UCMODE, flags, kbits, blkbits, ivbits) … argument 274 …static OSSL_FUNC_cipher_newctx_fn ossl_##alg##kbits##_##lc##_newctx; … 275 …static OSSL_FUNC_cipher_freectx_fn ossl_##alg##_##lc##_freectx; … 276 …static OSSL_FUNC_cipher_dupctx_fn ossl_##alg##_##lc##_dupctx; … 277 …static OSSL_FUNC_cipher_encrypt_init_fn ossl_##alg##_##lc##_einit; … 278 …static OSSL_FUNC_cipher_decrypt_init_fn ossl_##alg##_##lc##_dinit; … 279 …static OSSL_FUNC_cipher_update_fn ossl_##alg##_##lc##_stream_update; … 280 …static OSSL_FUNC_cipher_final_fn ossl_##alg##_##lc##_stream_final; … 281 …static OSSL_FUNC_cipher_cipher_fn ossl_##alg##_##lc##_cipher; … 282 …static OSSL_FUNC_cipher_get_params_fn ossl_##alg##_##kbits##_##lc##_get_params; … [all …]
|
| H A D | cipher_rc4.c | 71 #define IMPLEMENT_cipher(alg, UCALG, flags, kbits, blkbits, ivbits, typ) \ argument 72 static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_get_params; \ 73 static int alg##_##kbits##_get_params(OSSL_PARAM params[]) \ 78 static OSSL_FUNC_cipher_newctx_fn alg##_##kbits##_newctx; \ 79 static void *alg##_##kbits##_newctx(void *provctx) \ 87 ossl_prov_cipher_hw_##alg(kbits), NULL); \ 91 const OSSL_DISPATCH ossl_##alg##kbits##_functions[] = { \ 93 (void (*)(void))alg##_##kbits##_newctx }, \ 94 { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void))alg##_freectx }, \ 95 { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void))alg##_dupctx }, \ [all …]
|
| H A D | cipher_aes_siv.c | 244 #define IMPLEMENT_cipher(alg, lc, UCMODE, flags, kbits, blkbits, ivbits) \ argument 245 static OSSL_FUNC_cipher_newctx_fn alg##kbits##lc##_newctx; \ 246 static OSSL_FUNC_cipher_freectx_fn alg##_##lc##_freectx; \ 253 static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_##lc##_get_params; \ 254 static OSSL_FUNC_cipher_get_ctx_params_fn alg##_##lc##_get_ctx_params; \ 256 alg##_##lc##_gettable_ctx_params; \ 257 static OSSL_FUNC_cipher_set_ctx_params_fn alg##_##lc##_set_ctx_params; \ 259 alg##_##lc##_settable_ctx_params; \ 260 static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[]) \ 265 static void *alg##kbits##lc##_newctx(void *provctx) \ [all …]
|
| /src/crypto/openssl/providers/implementations/include/prov/ |
| H A D | ciphercommon_aead.h | 18 #define IMPLEMENT_aead_cipher(alg, lc, UCMODE, flags, kbits, blkbits, ivbits) \ argument 19 static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_##lc##_get_params; \ 20 static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[]) \ 25 static OSSL_FUNC_cipher_newctx_fn alg##kbits##lc##_newctx; \ 26 static void *alg##kbits##lc##_newctx(void *provctx) \ 28 return alg##_##lc##_newctx(provctx, kbits); \ 30 static void *alg##kbits##lc##_dupctx(void *src) \ 32 return alg##_##lc##_dupctx(src); \ 34 const OSSL_DISPATCH ossl_##alg##kbits##lc##_functions[] = { \ 35 { OSSL_FUNC_CIPHER_NEWCTX, (void (*)(void))alg##kbits##lc##_newctx }, \ [all …]
|
| H A D | ciphercommon.h | 136 #define IMPLEMENT_generic_cipher_func(alg, UCALG, lcmode, UCMODE, flags, kbits, \ argument 138 const OSSL_DISPATCH ossl_##alg##kbits##lcmode##_functions[] = { \ 140 (void (*)(void))alg##_##kbits##_##lcmode##_newctx }, \ 141 { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void))alg##_freectx }, \ 142 { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void))alg##_dupctx }, \ 149 (void (*)(void))alg##_##kbits##_##lcmode##_get_params }, \ 165 #define IMPLEMENT_var_keylen_cipher_func(alg, UCALG, lcmode, UCMODE, flags, \ argument 167 const OSSL_DISPATCH ossl_##alg##kbits##lcmode##_functions[] = { \ 169 (void (*)(void))alg##_##kbits##_##lcmode##_newctx }, \ 170 { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void))alg##_freectx }, \ [all …]
|
| /src/crypto/openssl/crypto/engine/ |
| H A D | eng_fat.c | 50 static int int_def_cb(const char *alg, int len, void *arg) in int_def_cb() argument 53 if (alg == NULL) in int_def_cb() 55 if (strncmp(alg, "ALL", len) == 0) in int_def_cb() 57 else if (strncmp(alg, "RSA", len) == 0) in int_def_cb() 59 else if (strncmp(alg, "DSA", len) == 0) in int_def_cb() 61 else if (strncmp(alg, "DH", len) == 0) in int_def_cb() 63 else if (strncmp(alg, "EC", len) == 0) in int_def_cb() 65 else if (strncmp(alg, "RAND", len) == 0) in int_def_cb() 67 else if (strncmp(alg, "CIPHERS", len) == 0) in int_def_cb() 69 else if (strncmp(alg, "DIGESTS", len) == 0) in int_def_cb() [all …]
|
| /src/contrib/llvm-project/libcxx/modules/std/ |
| H A D | algorithm.inc | 26 // [alg.nonmodifying], non-modifying sequence operations 27 // [alg.all.of], all of 33 // [alg.any.of], any of 39 // [alg.none.of], none of 46 // [alg.contains], contains 53 // [alg.foreach], for each 69 // [alg.find], find 81 // [alg.find.last], find last 89 // [alg.find.end], find end 96 // [alg.find.first.of], find first [all …]
|
| /src/crypto/openssl/test/ |
| H A D | mldsa_wycheproof_parse.py | 34 def parse_ml_dsa_sig_gen(alg, groups): argument 39 name = alg.replace('-', '_') 51 print_label("PrivateKeyRaw", keyname + ":" + alg + ":" + grp['privateKey']) 57 print_label("KeyFromData", alg) 61 print_label("Sign-Message", alg + ":" + keyname) 71 def parse_ml_dsa_sig_ver(alg, groups): argument 76 name = alg.replace('-', '_') 88 print_label("PublicKeyRaw", keyname + ":" + alg + ":" + grp['publicKey']) 94 print_label("KeyFromData", alg) 98 print_label("Verify-Message-Public", alg + ":" + keyname) [all …]
|
| /src/crypto/openssl/crypto/cms/ |
| H A D | cms_rsa.c | 19 static RSA_OAEP_PARAMS *rsa_oaep_decode(const X509_ALGOR *alg) in rsa_oaep_decode() argument 24 alg->parameter); in rsa_oaep_decode() 120 X509_ALGOR *alg; in rsa_cms_encrypt() local 125 if (CMS_RecipientInfo_ktri_get0_algs(ri, NULL, NULL, &alg) <= 0) in rsa_cms_encrypt() 132 return X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaEncryption), in rsa_cms_encrypt() 170 if (!X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaesOaep), V_ASN1_SEQUENCE, os)) in rsa_cms_encrypt() 198 X509_ALGOR *alg; in rsa_cms_sign() local 205 CMS_SignerInfo_get0_algs(si, NULL, NULL, NULL, &alg); in rsa_cms_sign() 211 return X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaEncryption), in rsa_cms_sign() 225 if (X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_PKEY_RSA_PSS), V_ASN1_SEQUENCE, os)) in rsa_cms_sign() [all …]
|
| /src/crypto/openssl/doc/man3/ |
| H A D | EVP_PKEY_CTX_get_algor.pod | 29 int EVP_TYPE_CTX_get_algor(EVP_TYPE_CTX *ctx, X509_ALGOR **alg); 30 int EVP_TYPE_CTX_get_algor_params(EVP_TYPE_CTX *ctx, X509_ALGOR *alg); 31 int EVP_TYPE_CTX_set_algor_params(EVP_TYPE_CTX *ctx, const X509_ALGOR *alg); 40 I<*alg> with it. 41 If I<alg> is NULL, calling this function will serve to see if calling this 43 If I<*alg> is NULL, space will be allocated automatically, and assigned to 44 I<*alg>. 48 populates I<alg->parameters> with it. 49 If I<alg> is NULL, calling this function will serve to see if calling this 51 If I<< alg->parameters >> is NULL, space will be allocated automatically, and [all …]
|
| /src/crypto/openssl/providers/implementations/encode_decode/ |
| H A D | ml_dsa_codecs.c | 391 params->alg); in ossl_ml_dsa_d2i_PUBKEY() 411 const X509_ALGOR *alg = NULL; in ossl_ml_dsa_d2i_PKCS8() local 428 if (!PKCS8_pkey_get0(NULL, &buf, &len, &alg, p8inf)) in ossl_ml_dsa_d2i_PKCS8() 431 if (OBJ_obj2nid(alg->algorithm) != evp_type) in ossl_ml_dsa_d2i_PKCS8() 437 fmt_slots = ossl_ml_common_pkcs8_fmt_order(v->alg, codec->p8fmt, in ossl_ml_dsa_d2i_PKCS8() 443 X509_ALGOR_get0(NULL, &ptype, NULL, alg); in ossl_ml_dsa_d2i_PKCS8() 447 v->alg); in ossl_ml_dsa_d2i_PKCS8() 470 v->alg); in ossl_ml_dsa_d2i_PKCS8() 536 "no %s public key data available", params->alg); in ossl_ml_dsa_i2d_pubkey() 567 params->alg); in ossl_ml_dsa_i2d_prvkey() [all …]
|
| /src/crypto/openssl/crypto/evp/ |
| H A D | kdf_meth.c | 186 void *alg; in EVP_KDF_gettable_ctx_params() local 190 alg = ossl_provider_ctx(EVP_KDF_get0_provider(kdf)); in EVP_KDF_gettable_ctx_params() 191 return kdf->gettable_ctx_params(NULL, alg); in EVP_KDF_gettable_ctx_params() 196 void *alg; in EVP_KDF_settable_ctx_params() local 200 alg = ossl_provider_ctx(EVP_KDF_get0_provider(kdf)); in EVP_KDF_settable_ctx_params() 201 return kdf->settable_ctx_params(NULL, alg); in EVP_KDF_settable_ctx_params() 206 void *alg; in EVP_KDF_CTX_gettable_params() local 210 alg = ossl_provider_ctx(EVP_KDF_get0_provider(ctx->meth)); in EVP_KDF_CTX_gettable_params() 211 return ctx->meth->gettable_ctx_params(ctx->algctx, alg); in EVP_KDF_CTX_gettable_params() 216 void *alg; in EVP_KDF_CTX_settable_params() local [all …]
|
| H A D | mac_meth.c | 207 void *alg; in EVP_MAC_gettable_ctx_params() local 211 alg = ossl_provider_ctx(EVP_MAC_get0_provider(mac)); in EVP_MAC_gettable_ctx_params() 212 return mac->gettable_ctx_params(NULL, alg); in EVP_MAC_gettable_ctx_params() 217 void *alg; in EVP_MAC_settable_ctx_params() local 221 alg = ossl_provider_ctx(EVP_MAC_get0_provider(mac)); in EVP_MAC_settable_ctx_params() 222 return mac->settable_ctx_params(NULL, alg); in EVP_MAC_settable_ctx_params() 227 void *alg; in EVP_MAC_CTX_gettable_params() local 231 alg = ossl_provider_ctx(EVP_MAC_get0_provider(ctx->meth)); in EVP_MAC_CTX_gettable_params() 232 return ctx->meth->gettable_ctx_params(ctx->algctx, alg); in EVP_MAC_CTX_gettable_params() 237 void *alg; in EVP_MAC_CTX_settable_params() local [all …]
|
| /src/crypto/openssl/crypto/pkcs7/ |
| H A D | pk7_attr.c | 61 X509_ALGOR *alg; in PKCS7_simple_smimecap() local 63 if ((alg = X509_ALGOR_new()) == NULL) { in PKCS7_simple_smimecap() 67 ASN1_OBJECT_free(alg->algorithm); in PKCS7_simple_smimecap() 68 alg->algorithm = OBJ_nid2obj(nid); in PKCS7_simple_smimecap() 70 if ((alg->parameter = ASN1_TYPE_new()) == NULL) { in PKCS7_simple_smimecap() 82 alg->parameter->value.integer = nbit; in PKCS7_simple_smimecap() 83 alg->parameter->type = V_ASN1_INTEGER; in PKCS7_simple_smimecap() 86 if (!sk_X509_ALGOR_push(sk, alg)) { in PKCS7_simple_smimecap() 93 X509_ALGOR_free(alg); in PKCS7_simple_smimecap()
|