Home
last modified time | relevance | path

Searched refs:alg (Results 1 – 25 of 352) sorted by relevance

12345678910>>...15

/third_party/mbedtls/include/psa/
Dcrypto_sizes.h65 #define PSA_HASH_LENGTH(alg) \ argument
67 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_MD5 ? 16 : \
68 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_RIPEMD160 ? 20 : \
69 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_1 ? 20 : \
70 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_224 ? 28 : \
71 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_256 ? 32 : \
72 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_384 ? 48 : \
73 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512 ? 64 : \
74 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_224 ? 28 : \
75 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_256 ? 32 : \
[all …]
Dcrypto_values.h738 #define PSA_ALG_IS_VENDOR_DEFINED(alg) \ argument
739 (((alg) & PSA_ALG_VENDOR_FLAG) != 0)
749 #define PSA_ALG_IS_HASH(alg) \ argument
750 (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_HASH)
760 #define PSA_ALG_IS_MAC(alg) \ argument
761 (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_MAC)
771 #define PSA_ALG_IS_CIPHER(alg) \ argument
772 (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_CIPHER)
783 #define PSA_ALG_IS_AEAD(alg) \ argument
784 (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_AEAD)
[all …]
Dcrypto.h281 psa_algorithm_t alg);
867 psa_status_t psa_hash_compute(psa_algorithm_t alg,
903 psa_status_t psa_hash_compare(psa_algorithm_t alg,
999 psa_algorithm_t alg);
1226 psa_algorithm_t alg,
1267 psa_algorithm_t alg,
1375 psa_algorithm_t alg);
1438 psa_algorithm_t alg);
1638 psa_algorithm_t alg,
1685 psa_algorithm_t alg,
[all …]
/third_party/libwebsockets/lib/cose/
Dcose_sign_alg.c32 lws_cose_sig_alg_t *alg = lws_zalloc(sizeof(*alg), __func__); in lws_cose_sign_alg_create() local
38 if (!alg) in lws_cose_sign_alg_create()
41 alg->cose_alg = cose_alg; in lws_cose_sign_alg_create()
42 alg->cose_key = ck; in lws_cose_sign_alg_create()
51 alg->keybits = 256; in lws_cose_sign_alg_create()
56 alg->keybits = 384; in lws_cose_sign_alg_create()
61 alg->keybits = 521; in lws_cose_sign_alg_create()
70 if (lws_genhash_init(&alg->hash_ctx, gh)) in lws_cose_sign_alg_create()
73 if (lws_genecdsa_create(&alg->u.ecdsactx, cx, lws_ec_curves)) { in lws_cose_sign_alg_create()
79 if (lws_genecdsa_set_key(&alg->u.ecdsactx, ck->e)) { in lws_cose_sign_alg_create()
[all …]
Dcose_validate_alg.c32 lws_cose_sig_alg_t *alg = lws_zalloc(sizeof(*alg), __func__); in lws_cose_val_alg_create() local
38 if (!alg) in lws_cose_val_alg_create()
41 alg->cose_alg = cose_alg; in lws_cose_val_alg_create()
42 alg->cose_key = ck; in lws_cose_val_alg_create()
51 alg->keybits = 256; in lws_cose_val_alg_create()
56 alg->keybits = 384; in lws_cose_val_alg_create()
61 alg->keybits = 521; in lws_cose_val_alg_create()
70 if (lws_genhash_init(&alg->hash_ctx, gh)) in lws_cose_val_alg_create()
73 if (lws_genecdsa_create(&alg->u.ecdsactx, cx, lws_ec_curves)) { in lws_cose_val_alg_create()
79 if (lws_genecdsa_set_key(&alg->u.ecdsactx, ck->e)) { in lws_cose_val_alg_create()
[all …]
Dcose_sign.c55 lws_cose_sign_add(struct lws_cose_sign_context *csc, cose_param_t alg, in lws_cose_sign_add() argument
58 lws_cose_sig_alg_t *si = lws_cose_sign_alg_create(csc->info.cx, ck, alg, in lws_cose_sign_add()
88 lws_cose_sig_alg_t *alg = lws_container_of(p, in lws_cose_sign_hashing() local
91 if (lws_cose_sign_alg_hash(alg, in, in_len)) in lws_cose_sign_hashing()
92 alg->failed = 1; in lws_cose_sign_hashing()
111 lws_cose_sig_alg_t *alg; in lws_cose_sign_payload_chunk() local
129 alg = lws_container_of(csc->algs.head, lws_cose_sig_alg_t, list); in lws_cose_sign_payload_chunk()
131 switch (alg->cose_alg) { in lws_cose_sign_payload_chunk()
207 alg = lws_container_of(csc->algs.head, in lws_cose_sign_payload_chunk()
214 (long long)alg->cose_alg); in lws_cose_sign_payload_chunk()
[all …]
Dcose_validate.c50 cose_param_t alg; member
122 lws_cose_alg_to_name(cose_param_t alg) in lws_cose_alg_to_name() argument
127 if (alg_names[n].alg == alg) in lws_cose_alg_to_name()
140 return alg_names[n].alg; in lws_cose_name_to_alg()
192 lws_cose_sig_alg_t *alg; in apply_external() local
195 alg = lws_container_of(cps->algs.head, lws_cose_sig_alg_t, list); in apply_external()
196 if (!alg) in apply_external()
208 if (lws_cose_val_alg_hash(alg, t, s)) in apply_external()
221 lws_cose_val_alg_hash(alg, ex.ext, ex.xl)) in apply_external()
240 lws_cose_sig_alg_t *alg; in create_alg() local
[all …]
/third_party/mbedtls/tests/suites/
Dtest_suite_psa_crypto_metadata.function72 * PSA_##flag(alg) is true.
81 #define TEST_CLASSIFICATION_MACRO( cond, flag, alg, flags ) \
87 TEST_ASSERT( PSA_##flag( alg ) ); \
89 TEST_ASSERT( ! PSA_##flag( alg ) ); \
117 void algorithm_classification( psa_algorithm_t alg, unsigned flags )
120 TEST_CLASSIFICATION_MACRO( 1, ALG_IS_VENDOR_DEFINED, alg, flags );
121 TEST_CLASSIFICATION_MACRO( 1, ALG_IS_HMAC, alg, flags );
122 TEST_CLASSIFICATION_MACRO( 1, ALG_IS_BLOCK_CIPHER_MAC, alg, flags );
123 TEST_CLASSIFICATION_MACRO( 1, ALG_IS_STREAM_CIPHER, alg, flags );
124 TEST_CLASSIFICATION_MACRO( 1, ALG_IS_RSA_PKCS1V15_SIGN, alg, flags );
[all …]
Dtest_suite_psa_crypto.function145 psa_algorithm_t alg,
153 psa_set_key_algorithm( &attributes, alg );
157 *status = psa_mac_sign_setup( operation, key, alg );
164 TEST_EQUAL( psa_mac_sign_setup( operation, key, alg ), *status );
178 psa_algorithm_t alg,
186 psa_set_key_algorithm( &attributes, alg );
190 *status = psa_cipher_encrypt_setup( operation, key, alg );
197 TEST_EQUAL( psa_cipher_encrypt_setup( operation, key, alg ),
332 psa_algorithm_t alg = alg_arg;
364 psa_set_key_algorithm( &attributes, alg );
[all …]
/third_party/mbedtls/tests/src/
Dpsa_exercise_key.c119 psa_algorithm_t alg ) in exercise_mac_key() argument
127 if( alg & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG ) in exercise_mac_key()
129 alg = PSA_ALG_TRUNCATED_MAC( alg, PSA_MAC_TRUNCATED_LENGTH( alg ) ); in exercise_mac_key()
134 PSA_ASSERT( psa_mac_sign_setup( &operation, key, alg ) ); in exercise_mac_key()
148 PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) ); in exercise_mac_key()
164 psa_algorithm_t alg ) in exercise_cipher_key() argument
177 PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) ); in exercise_cipher_key()
204 maybe_invalid_padding = ! PSA_ALG_IS_STREAM_CIPHER( alg ); in exercise_cipher_key()
207 PSA_ASSERT( psa_cipher_decrypt_setup( &operation, key, alg ) ); in exercise_cipher_key()
237 psa_algorithm_t alg ) in exercise_aead_key() argument
[all …]
/third_party/mbedtls/tests/src/drivers/
Dtest_driver_signature.c58 psa_algorithm_t alg, in sign_hash() argument
67 if( PSA_ALG_IS_RSA_PKCS1V15_SIGN( alg ) || in sign_hash()
68 PSA_ALG_IS_RSA_PSS( alg) ) in sign_hash()
76 alg, hash, hash_length, in sign_hash()
83 alg, hash, hash_length, in sign_hash()
94 if( PSA_ALG_IS_ECDSA( alg ) ) in sign_hash()
102 alg, hash, hash_length, in sign_hash()
109 alg, hash, hash_length, in sign_hash()
122 (void)alg; in sign_hash()
135 psa_algorithm_t alg, in verify_hash() argument
[all …]
Dtest_driver_cipher.c46 psa_algorithm_t alg, in mbedtls_test_transparent_cipher_encrypt() argument
78 alg, iv, iv_length, input, input_length, in mbedtls_test_transparent_cipher_encrypt()
83 alg, iv, iv_length, input, input_length, in mbedtls_test_transparent_cipher_encrypt()
94 psa_algorithm_t alg, in mbedtls_test_transparent_cipher_decrypt() argument
124 alg, input, input_length, in mbedtls_test_transparent_cipher_decrypt()
129 alg, input, input_length, in mbedtls_test_transparent_cipher_decrypt()
140 psa_algorithm_t alg) in mbedtls_test_transparent_cipher_encrypt_setup() argument
158 key, key_length, alg ) ); in mbedtls_test_transparent_cipher_encrypt_setup()
161 operation, attributes, key, key_length, alg ) ); in mbedtls_test_transparent_cipher_encrypt_setup()
171 psa_algorithm_t alg) in mbedtls_test_transparent_cipher_decrypt_setup() argument
[all …]
/third_party/mbedtls/library/
Dpsa_crypto_mac.c53 hmac->alg = hash_alg; in psa_hmac_setup_internal()
120 psa_algorithm_t hash_alg = hmac->alg; in psa_hmac_finish_internal()
199 psa_algorithm_t alg ) in mac_init() argument
203 operation->alg = alg; in mac_init()
206 if( PSA_ALG_FULL_LENGTH_MAC( operation->alg ) == PSA_ALG_CMAC ) in mac_init()
214 if( PSA_ALG_IS_HMAC( operation->alg ) ) in mac_init()
217 operation->ctx.hmac.alg = 0; in mac_init()
234 if( operation->alg == 0 ) in mbedtls_psa_mac_abort()
243 if( PSA_ALG_FULL_LENGTH_MAC( operation->alg ) == PSA_ALG_CMAC ) in mbedtls_psa_mac_abort()
250 if( PSA_ALG_IS_HMAC( operation->alg ) ) in mbedtls_psa_mac_abort()
[all …]
Dpsa_crypto_aead.c46 psa_algorithm_t alg ) in psa_aead_setup() argument
58 cipher_info = mbedtls_cipher_info_from_psa( alg, in psa_aead_setup()
64 switch( PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 0 ) ) in psa_aead_setup()
68 operation->alg = PSA_ALG_CCM; in psa_aead_setup()
87 operation->alg = PSA_ALG_GCM; in psa_aead_setup()
106 operation->alg = PSA_ALG_CHACHA20_POLY1305; in psa_aead_setup()
109 if( alg != PSA_ALG_CHACHA20_POLY1305 ) in psa_aead_setup()
128 key_bits, alg ) in psa_aead_setup()
136 alg ); in psa_aead_setup()
144 psa_algorithm_t alg, in mbedtls_psa_aead_encrypt() argument
[all …]
Dpsa_crypto_cipher.c35 psa_algorithm_t alg, in mbedtls_cipher_info_from_psa() argument
43 if( PSA_ALG_IS_AEAD( alg ) ) in mbedtls_cipher_info_from_psa()
44 alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 0 ); in mbedtls_cipher_info_from_psa()
46 if( PSA_ALG_IS_CIPHER( alg ) || PSA_ALG_IS_AEAD( alg ) ) in mbedtls_cipher_info_from_psa()
48 switch( alg ) in mbedtls_cipher_info_from_psa()
87 else if( alg == PSA_ALG_CMAC ) in mbedtls_cipher_info_from_psa()
135 psa_algorithm_t alg, in psa_cipher_setup() argument
147 operation->alg = alg; in psa_cipher_setup()
149 cipher_info = mbedtls_cipher_info_from_psa( alg, key_type, in psa_cipher_setup()
180 switch( alg ) in psa_cipher_setup()
[all …]
Dpsa_crypto_driver_wrappers.c113 psa_algorithm_t alg, in psa_driver_wrapper_sign_message() argument
135 alg, in psa_driver_wrapper_sign_message()
156 alg, in psa_driver_wrapper_sign_message()
176 alg, in psa_driver_wrapper_sign_message()
188 psa_algorithm_t alg, in psa_driver_wrapper_verify_message() argument
209 alg, in psa_driver_wrapper_verify_message()
229 alg, in psa_driver_wrapper_verify_message()
248 alg, in psa_driver_wrapper_verify_message()
258 psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, in psa_driver_wrapper_sign_hash() argument
276 alg, hash, hash_length, in psa_driver_wrapper_sign_hash()
[all …]
Dpsa_crypto.c819 psa_algorithm_t alg ) in psa_key_policy_permits() argument
822 if( alg == 0 ) in psa_key_policy_permits()
826 if( PSA_ALG_IS_WILDCARD( alg ) ) in psa_key_policy_permits()
829 if( psa_key_algorithm_permits( key_type, policy->alg, alg ) || in psa_key_policy_permits()
830 psa_key_algorithm_permits( key_type, policy->alg2, alg ) ) in psa_key_policy_permits()
860 psa_key_policy_algorithm_intersection( key_type, policy->alg, in psa_restrict_key_policy()
861 constraint->alg ); in psa_restrict_key_policy()
865 if( intersection_alg == 0 && policy->alg != 0 && constraint->alg != 0 ) in psa_restrict_key_policy()
870 policy->alg = intersection_alg; in psa_restrict_key_policy()
892 psa_algorithm_t alg ) in psa_get_and_lock_key_slot_with_policy() argument
[all …]
Dpsa_crypto_hash.c36 const mbedtls_md_info_t *mbedtls_md_info_from_psa( psa_algorithm_t alg ) in mbedtls_md_info_from_psa() argument
38 switch( alg ) in mbedtls_md_info_from_psa()
81 switch( operation->alg ) in mbedtls_psa_hash_abort()
126 operation->alg = 0; in mbedtls_psa_hash_abort()
132 psa_algorithm_t alg ) in mbedtls_psa_hash_setup() argument
137 if( operation->alg != 0 ) in mbedtls_psa_hash_setup()
142 switch( alg ) in mbedtls_psa_hash_setup()
187 return( PSA_ALG_IS_HASH( alg ) ? in mbedtls_psa_hash_setup()
192 operation->alg = alg; in mbedtls_psa_hash_setup()
202 switch( source_operation->alg ) in mbedtls_psa_hash_clone()
[all …]
/third_party/ltp/testcases/network/tcp_cc/
Dtcp_cc_lib.sh20 local alg=$1
21 tst_res TINFO "setting $alg"
23 tst_set_sysctl net.ipv4.tcp_congestion_control $alg safe
43 local alg="$1"
45 modprobe tcp_$alg > /dev/null 2>&1
46 grep -q $alg $proc_cc || tst_brk TCONF "Local host doesn't support $alg"
49 tst_rhost_run -c "modprobe tcp_$alg" > /dev/null 2>&1
50 tst_rhost_run -c "grep -q $alg $proc_cc" || \
51 tst_brk TCONF "Remote host doesn't support $alg"
90 local alg=$1
[all …]
/third_party/openssl/crypto/engine/
Deng_fat.c49 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 …]
/third_party/node/deps/npm/node_modules/http-signature/lib/
Dsigner.js40 var alg = [];
43 alg = validateAlgorithm(options.algorithm);
45 this.rs_alg = alg;
61 } else if (alg[0] === 'hmac' && options.key !== undefined) {
73 this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key);
77 hashAlgorithm: alg[1],
99 if (alg[0] !== undefined && key.type !== alg[0]) {
101 alg[0].toUpperCase() + ' key, was given a ' +
105 this.rs_signer = key.createSign(alg[1]);
176 var alg, authz;
[all …]
Dutils.js34 var alg = algorithm.toLowerCase().split('-');
36 if (alg.length !== 2) {
37 throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' +
41 if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) {
42 throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' +
46 if (!HASH_ALGOS[alg[1]]) {
47 throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' +
51 return (alg);
/third_party/mbedtls/tests/scripts/
Ddepends-pkalgs.pl83 while( my ($alg, $extras) = each %algs ) {
88 print "* Testing without alg: $alg\n";
90 $ENV{MBEDTLS_TEST_CONFIGURATION} = "-$alg";
92 system( "scripts/config.py unset $alg" )
93 and abort "Failed to disable $alg\n";
100 and abort "Failed to build lib: $alg\n";
101 system( "cd tests && make" ) and abort "Failed to build tests: $alg\n";
102 system( "make test" ) and abort "Failed test suite: $alg\n";
/third_party/ltp/testcases/kernel/crypto/
Dcrypto_user02.c62 struct crypto_user_alg alg; in setup() local
67 memset(&alg, 0, sizeof(alg)); in setup()
68 strcpy(alg.cru_driver_name, ALGORITHM_CANDIDATES[i]); in setup()
71 rc = tst_crypto_add_alg(&ses, &alg); in setup()
76 rc = tst_crypto_del_alg(&ses, &alg); in setup()
89 struct crypto_user_alg alg = {}; in run() local
93 strcpy(alg.cru_driver_name, algorithm); in run()
108 TEST(tst_crypto_add_alg(&ses, &alg)); in run()
126 TEST(tst_crypto_del_alg(&ses, &alg)); in run()
/third_party/openssl/crypto/asn1/
Dx_algor.c29 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 …]

12345678910>>...15