| /netbsd-src/crypto/external/bsd/openssh/dist/ |
| H A D | digest-libc.c | 40 int alg; member 110 ssh_digest_by_alg(int alg) in ssh_digest_by_alg() argument 112 if (alg < 0 || alg >= SSH_DIGEST_MAX) in ssh_digest_by_alg() 114 if (digests[alg].id != alg) /* sanity */ in ssh_digest_by_alg() 116 return &(digests[alg]); in ssh_digest_by_alg() 122 int alg; in ssh_digest_alg_by_name() local 124 for (alg = 0; alg < SSH_DIGEST_MAX; alg++) { in ssh_digest_alg_by_name() 125 if (strcasecmp(name, digests[alg].name) == 0) in ssh_digest_alg_by_name() 126 return digests[alg].id; in ssh_digest_alg_by_name() 132 ssh_digest_alg_name(int alg) in ssh_digest_alg_name() argument [all …]
|
| H A D | digest-openssl.c | 34 int alg; member 56 ssh_digest_by_alg(int alg) in ssh_digest_by_alg() argument 58 if (alg < 0 || alg >= SSH_DIGEST_MAX) in ssh_digest_by_alg() 60 if (digests[alg].id != alg) /* sanity */ in ssh_digest_by_alg() 62 return &(digests[alg]); in ssh_digest_by_alg() 68 int alg; in ssh_digest_alg_by_name() local 70 for (alg = 0; digests[alg].id != -1; alg++) { in ssh_digest_alg_by_name() 71 if (strcasecmp(name, digests[alg].name) == 0) in ssh_digest_alg_by_name() 72 return digests[alg].id; in ssh_digest_alg_by_name() 78 ssh_digest_alg_name(int alg) in ssh_digest_alg_name() argument [all …]
|
| /netbsd-src/crypto/external/bsd/openssl/dist/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_siv.c | 255 #define IMPLEMENT_cipher(alg, lc, UCMODE, flags, kbits, blkbits, ivbits) \ argument 256 static OSSL_FUNC_cipher_newctx_fn alg##kbits##lc##_newctx; \ 257 static OSSL_FUNC_cipher_freectx_fn alg##_##lc##_freectx; \ 264 static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_##lc##_get_params; \ 265 static OSSL_FUNC_cipher_get_ctx_params_fn alg##_##lc##_get_ctx_params; \ 267 alg##_##lc##_gettable_ctx_params; \ 268 static OSSL_FUNC_cipher_set_ctx_params_fn alg##_##lc##_set_ctx_params; \ 270 alg##_##lc##_settable_ctx_params; \ 271 static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[]) \ 276 static void * alg##kbits##lc##_newctx(void *provctx) \ [all …]
|
| H A D | cipher_rc4.c | 73 #define IMPLEMENT_cipher(alg, UCALG, flags, kbits, blkbits, ivbits, typ) \ argument 74 static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_get_params; \ 75 static int alg##_##kbits##_get_params(OSSL_PARAM params[]) \ 80 static OSSL_FUNC_cipher_newctx_fn alg##_##kbits##_newctx; \ 81 static void * alg##_##kbits##_newctx(void *provctx) \ 89 ossl_prov_cipher_hw_##alg(kbits), NULL); \ 93 const OSSL_DISPATCH ossl_##alg##kbits##_functions[] = { \ 95 (void (*)(void)) alg##_##kbits##_newctx }, \ 96 { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void)) alg##_freectx }, \ 97 { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void)) alg##_dupctx }, \ [all …]
|
| /netbsd-src/external/mpl/dhcp/bind/dist/lib/dns/ |
| H A D | hmac_link.c | 64 #define hmac_register_algorithm(alg) \ argument 65 static isc_result_t hmac##alg##_createctx(dst_key_t *key, \ 67 return (hmac_createctx(ISC_MD_##alg, key, dctx)); \ 69 static void hmac##alg##_destroyctx(dst_context_t *dctx) { \ 72 static isc_result_t hmac##alg##_adddata(dst_context_t *dctx, \ 76 static isc_result_t hmac##alg##_sign(dst_context_t *dctx, \ 80 static isc_result_t hmac##alg##_verify(dst_context_t *dctx, \ 84 static bool hmac##alg##_compare(const dst_key_t *key1, \ 86 return (hmac_compare(ISC_MD_##alg, key1, key2)); \ 88 static isc_result_t hmac##alg##_generate( \ [all …]
|
| /netbsd-src/external/mpl/bind/dist/lib/dns/ |
| H A D | hmac_link.c | 57 #define hmac_register_algorithm(alg) \ 58 static isc_result_t hmac##alg##_createctx(dst_key_t *key, \ 60 return (hmac_createctx(ISC_MD_##alg, key, dctx)); \ argument 62 static void hmac##alg##_destroyctx(dst_context_t *dctx) { \ 65 static isc_result_t hmac##alg##_adddata(dst_context_t *dctx, \ 69 static isc_result_t hmac##alg##_sign(dst_context_t *dctx, \ 73 static isc_result_t hmac##alg##_verify(dst_context_t *dctx, \ 77 static bool hmac##alg##_compare(const dst_key_t *key1, \ 79 return (hmac_compare(ISC_MD_##alg, key1, key2)); \ 81 static isc_result_t hmac##alg##_generat [all...] |
| /netbsd-src/crypto/external/bsd/openssl/dist/crypto/asn1/ |
| H A D | x_algor.c | 31 int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) 33 if (alg == NULL) 37 if (alg->parameter == NULL) 38 alg->parameter = ASN1_TYPE_new(); 39 if (alg->parameter == NULL) 43 ASN1_OBJECT_free(alg->algorithm); 44 alg->algorithm = aobj; 49 ASN1_TYPE_free(alg->parameter); 50 alg->parameter = NULL; 52 ASN1_TYPE_set(alg->parameter, ptype, pval); [all …]
|
| /netbsd-src/crypto/external/bsd/openssl/dist/providers/implementations/include/prov/ |
| H A D | ciphercommon_aead.h | 14 #define IMPLEMENT_aead_cipher(alg, lc, UCMODE, flags, kbits, blkbits, ivbits) \ argument 15 static OSSL_FUNC_cipher_get_params_fn alg##_##kbits##_##lc##_get_params; \ 16 static int alg##_##kbits##_##lc##_get_params(OSSL_PARAM params[]) \ 21 static OSSL_FUNC_cipher_newctx_fn alg##kbits##lc##_newctx; \ 22 static void * alg##kbits##lc##_newctx(void *provctx) \ 24 return alg##_##lc##_newctx(provctx, kbits); \ 26 static void * alg##kbits##lc##_dupctx(void *src) \ 28 return alg##_##lc##_dupctx(src); \ 30 const OSSL_DISPATCH ossl_##alg##kbits##lc##_functions[] = { \ 31 { OSSL_FUNC_CIPHER_NEWCTX, (void (*)(void))alg##kbits##lc##_newctx }, \ [all …]
|
| H A D | ciphercommon.h | 130 #define IMPLEMENT_generic_cipher_func(alg, UCALG, lcmode, UCMODE, flags, kbits,\ argument 132 const OSSL_DISPATCH ossl_##alg##kbits##lcmode##_functions[] = { \ 134 (void (*)(void)) alg##_##kbits##_##lcmode##_newctx }, \ 135 { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void)) alg##_freectx }, \ 136 { OSSL_FUNC_CIPHER_DUPCTX, (void (*)(void)) alg##_dupctx }, \ 143 (void (*)(void)) alg##_##kbits##_##lcmode##_get_params }, \ 157 #define IMPLEMENT_var_keylen_cipher_func(alg, UCALG, lcmode, UCMODE, flags, \ argument 159 const OSSL_DISPATCH ossl_##alg##kbits##lcmode##_functions[] = { \ 161 (void (*)(void)) alg##_##kbits##_##lcmode##_newctx }, \ 162 { OSSL_FUNC_CIPHER_FREECTX, (void (*)(void)) alg##_freectx }, \ [all …]
|
| /netbsd-src/sys/net/npf/ |
| H A D | npf_alg.c | 95 npf_alg_t *alg = &aset->alg_list[i]; in npf_alg_lookup() local 96 const char *aname = alg->na_name; in npf_alg_lookup() 99 return alg; in npf_alg_lookup() 107 npf_alg_t *alg; in npf_alg_construct() local 110 if ((alg = npf_alg_lookup(npf, name)) == NULL) { in npf_alg_construct() 120 alg = npf_alg_lookup(npf, name); in npf_alg_construct() 123 return alg; in npf_alg_construct() 134 npf_alg_t *alg; in npf_alg_register() local 145 alg = &aset->alg_list[i]; in npf_alg_register() 146 if (alg->na_name == NULL) { in npf_alg_register() [all …]
|
| /netbsd-src/crypto/external/bsd/heimdal/dist/lib/otp/ |
| H A D | otptest.c | 45 OtpAlgorithm *alg) in test_one() argument 56 if (otp_parse (key2, buf, alg)) { in test_one() 71 char *alg; in test() member 118 for(t = tests; t->alg; ++t) { in test() 120 OtpAlgorithm *alg = otp_find_alg (t->alg); in test() local 123 if (alg == NULL) { in test() 124 printf ("Could not find alg %s\n", t->alg); in test() 127 if(alg->init (key, t->passphrase, t->seed)) in test() 130 if (alg->next (key)) in test() 134 alg) + in test() [all …]
|
| H A D | otp_parse.c | 92 OtpAlgorithm *alg = (OtpAlgorithm *)a; in get_altword() local 94 unsigned char *res = malloc(alg->hashsize); in get_altword() 98 alg->hash (s, strlen(s), res); in get_altword() 99 ret = (unsigned)(res[alg->hashsize - 1]) | in get_altword() 100 ((res[alg->hashsize - 2] & 0x03) << 8); in get_altword() 143 OtpAlgorithm *alg, in otp_parse_internal() argument 148 if (parse_words (wn, str, convert, alg)) in otp_parse_internal() 163 otp_parse_altdict (OtpKey key, const char *str, OtpAlgorithm *alg) in otp_parse_altdict() argument 165 return otp_parse_internal (key, str, alg, get_altword); in otp_parse_altdict() 196 otp_parse (OtpKey key, const char *s, OtpAlgorithm *alg) in otp_parse() argument [all …]
|
| /netbsd-src/external/mpl/bind/dist/bin/tests/system/ |
| H A D | testcrypto.sh | |
| /netbsd-src/crypto/external/bsd/openssl/dist/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 …]
|
| /netbsd-src/crypto/external/bsd/openssl.old/dist/crypto/engine/ |
| H A D | eng_fat.c | 49 static int int_def_cb(const char *alg, int len, void *arg) in int_def_cb() argument 52 if (alg == NULL) in int_def_cb() 54 if (strncmp(alg, "ALL", len) == 0) in int_def_cb() 56 else if (strncmp(alg, "RSA", len) == 0) in int_def_cb() 58 else if (strncmp(alg, "DSA", len) == 0) in int_def_cb() 60 else if (strncmp(alg, "DH", len) == 0) in int_def_cb() 62 else if (strncmp(alg, "EC", len) == 0) in int_def_cb() 64 else if (strncmp(alg, "RAND", len) == 0) in int_def_cb() 66 else if (strncmp(alg, "CIPHERS", len) == 0) in int_def_cb() 68 else if (strncmp(alg, "DIGESTS", len) == 0) in int_def_cb() [all …]
|
| /netbsd-src/crypto/external/bsd/openssl.old/dist/crypto/asn1/ |
| H A D | x_algor.c | 29 int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) 31 if (alg == NULL) 35 if (alg->parameter == NULL) 36 alg->parameter = ASN1_TYPE_new(); 37 if (alg->parameter == NULL) 41 ASN1_OBJECT_free(alg->algorithm); 42 alg->algorithm = aobj; 47 ASN1_TYPE_free(alg->parameter); 48 alg->parameter = NULL; 50 ASN1_TYPE_set(alg->parameter, ptype, pval); [all …]
|
| /netbsd-src/crypto/external/bsd/openssl/dist/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() 171 if (!X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaesOaep), V_ASN1_SEQUENCE, os)) in rsa_cms_encrypt() 199 X509_ALGOR *alg; in rsa_cms_sign() local 206 CMS_SignerInfo_get0_algs(si, NULL, NULL, NULL, &alg); in rsa_cms_sign() 212 X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsaEncryption), V_ASN1_NULL, 0); in rsa_cms_sign() 226 return X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_PKEY_RSA_PSS), V_ASN1_SEQUENCE, os); in rsa_cms_sign() [all …]
|
| /netbsd-src/crypto/external/bsd/openssl/dist/crypto/evp/ |
| H A D | kdf_meth.c | 187 void *alg; in EVP_KDF_gettable_ctx_params() local 191 alg = ossl_provider_ctx(EVP_KDF_get0_provider(kdf)); in EVP_KDF_gettable_ctx_params() 192 return kdf->gettable_ctx_params(NULL, alg); in EVP_KDF_gettable_ctx_params() 197 void *alg; in EVP_KDF_settable_ctx_params() local 201 alg = ossl_provider_ctx(EVP_KDF_get0_provider(kdf)); in EVP_KDF_settable_ctx_params() 202 return kdf->settable_ctx_params(NULL, alg); in EVP_KDF_settable_ctx_params() 207 void *alg; in EVP_KDF_CTX_gettable_params() local 211 alg = ossl_provider_ctx(EVP_KDF_get0_provider(ctx->meth)); in EVP_KDF_CTX_gettable_params() 212 return ctx->meth->gettable_ctx_params(ctx->algctx, alg); in EVP_KDF_CTX_gettable_params() 217 void *alg; in EVP_KDF_CTX_settable_params() local [all …]
|
| H A D | mac_meth.c | 201 void *alg; in EVP_MAC_gettable_ctx_params() local 205 alg = ossl_provider_ctx(EVP_MAC_get0_provider(mac)); in EVP_MAC_gettable_ctx_params() 206 return mac->gettable_ctx_params(NULL, alg); in EVP_MAC_gettable_ctx_params() 211 void *alg; in EVP_MAC_settable_ctx_params() local 215 alg = ossl_provider_ctx(EVP_MAC_get0_provider(mac)); in EVP_MAC_settable_ctx_params() 216 return mac->settable_ctx_params(NULL, alg); in EVP_MAC_settable_ctx_params() 221 void *alg; in EVP_MAC_CTX_gettable_params() local 225 alg = ossl_provider_ctx(EVP_MAC_get0_provider(ctx->meth)); in EVP_MAC_CTX_gettable_params() 226 return ctx->meth->gettable_ctx_params(ctx->algctx, alg); in EVP_MAC_CTX_gettable_params() 231 void *alg; in EVP_MAC_CTX_settable_params() local [all …]
|
| /netbsd-src/lib/libresolv/ |
| H A D | dst_api.c | 81 static DST_KEY *dst_s_get_key_struct(const char *name, const int alg, 147 dst_check_algorithm(const int alg) in dst_check_algorithm() argument 149 return (dst_t_func[alg] != NULL); in dst_check_algorithm() 167 dst_s_get_key_struct(const char *name, const int alg, const int flags, in dst_s_get_key_struct() argument 172 if (dst_check_algorithm(alg)) /*%< make sure alg is available */ in dst_s_get_key_struct() 183 new_key->dk_alg = alg; in dst_s_get_key_struct() 188 new_key->dk_func = dst_t_func[alg]; in dst_s_get_key_struct() 473 int flags, proto, alg, dlen; in dst_s_read_public_key() local 543 if (fscanf(fp, "%d %d %d", &flags, &proto, &alg) != 3) { in dst_s_read_public_key() 579 return dst_buffer_to_key(in_name, alg, flags, proto, deckey, dlen); in dst_s_read_public_key() [all …]
|
| /netbsd-src/external/bsd/libbind/dist/dst/ |
| H A D | dst_api.c | 79 static DST_KEY *dst_s_get_key_struct(const char *name, const int alg, 143 dst_check_algorithm(const int alg) in dst_check_algorithm() argument 145 return (dst_t_func[alg] != NULL); in dst_check_algorithm() 163 dst_s_get_key_struct(const char *name, const int alg, const int flags, in dst_s_get_key_struct() argument 168 if (dst_check_algorithm(alg)) /*%< make sure alg is available */ in dst_s_get_key_struct() 179 new_key->dk_alg = alg; in dst_s_get_key_struct() 184 new_key->dk_func = dst_t_func[alg]; in dst_s_get_key_struct() 467 int flags, proto, alg, len, dlen; in dst_s_read_public_key() local 536 if (fscanf(fp, "%d %d %d", &flags, &proto, &alg) != 3) { in dst_s_read_public_key() 573 return dst_buffer_to_key(in_name, alg, flags, proto, deckey, dlen); in dst_s_read_public_key() [all …]
|
| /netbsd-src/crypto/external/bsd/openssl.old/dist/crypto/pkcs7/ |
| H A D | pk7_attr.c | 53 X509_ALGOR *alg; in PKCS7_simple_smimecap() local 55 if ((alg = X509_ALGOR_new()) == NULL) { in PKCS7_simple_smimecap() 59 ASN1_OBJECT_free(alg->algorithm); in PKCS7_simple_smimecap() 60 alg->algorithm = OBJ_nid2obj(nid); in PKCS7_simple_smimecap() 62 if ((alg->parameter = ASN1_TYPE_new()) == NULL) { in PKCS7_simple_smimecap() 71 alg->parameter->value.integer = nbit; in PKCS7_simple_smimecap() 72 alg->parameter->type = V_ASN1_INTEGER; in PKCS7_simple_smimecap() 75 if (!sk_X509_ALGOR_push(sk, alg)) { in PKCS7_simple_smimecap() 82 X509_ALGOR_free(alg); in PKCS7_simple_smimecap()
|
| /netbsd-src/crypto/external/bsd/openssl.old/dist/crypto/rsa/ |
| H A D | rsa_ameth.c | 27 static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg); 54 static int rsa_param_decode(RSA *rsa, const X509_ALGOR *alg) in rsa_param_decode() argument 60 X509_ALGOR_get0(&algoid, &algptype, &algp, alg); in rsa_param_decode() 69 rsa->pss = rsa_pss_decode(alg); in rsa_param_decode() 99 X509_ALGOR *alg; in rsa_pub_decode() local 102 if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &alg, pubkey)) in rsa_pub_decode() 108 if (!rsa_param_decode(rsa, alg)) { in rsa_pub_decode() 187 const X509_ALGOR *alg; in rsa_priv_decode() local 189 if (!PKCS8_pkey_get0(NULL, &p, &pklen, &alg, p8)) in rsa_priv_decode() 196 if (!rsa_param_decode(rsa, alg)) { in rsa_priv_decode() [all …]
|
| /netbsd-src/crypto/external/bsd/openssl/dist/crypto/pkcs7/ |
| H A D | pk7_attr.c | 57 X509_ALGOR *alg; in PKCS7_simple_smimecap() local 59 if ((alg = X509_ALGOR_new()) == NULL) { in PKCS7_simple_smimecap() 63 ASN1_OBJECT_free(alg->algorithm); in PKCS7_simple_smimecap() 64 alg->algorithm = OBJ_nid2obj(nid); in PKCS7_simple_smimecap() 66 if ((alg->parameter = ASN1_TYPE_new()) == NULL) { in PKCS7_simple_smimecap() 75 alg->parameter->value.integer = nbit; in PKCS7_simple_smimecap() 76 alg->parameter->type = V_ASN1_INTEGER; in PKCS7_simple_smimecap() 79 if (!sk_X509_ALGOR_push(sk, alg)) { in PKCS7_simple_smimecap() 86 X509_ALGOR_free(alg); in PKCS7_simple_smimecap()
|