/external/python/cryptography/src/cryptography/hazmat/backends/openssl/ |
D | encode_asn1.py | 23 def _encode_asn1_int(backend, x): argument 34 i = backend._int_to_bn(x) 35 i = backend._ffi.gc(i, backend._lib.BN_free) 38 i = backend._lib.BN_to_ASN1_INTEGER(i, backend._ffi.NULL) 39 backend.openssl_assert(i != backend._ffi.NULL) 43 def _encode_asn1_int_gc(backend, x): argument 44 i = _encode_asn1_int(backend, x) 45 i = backend._ffi.gc(i, backend._lib.ASN1_INTEGER_free) 49 def _encode_asn1_str(backend, data): argument 53 s = backend._lib.ASN1_OCTET_STRING_new() [all …]
|
D | decode_asn1.py | 27 def _obj2txt(backend, obj): argument 37 buf = backend._ffi.new("char[]", buf_len) 42 res = backend._lib.OBJ_obj2txt(buf, buf_len, obj, 1) 45 buf = backend._ffi.new("char[]", buf_len) 46 res = backend._lib.OBJ_obj2txt(buf, buf_len, obj, 1) 47 backend.openssl_assert(res > 0) 48 return backend._ffi.buffer(buf, res)[:].decode() 51 def _decode_x509_name_entry(backend, x509_name_entry): argument 52 obj = backend._lib.X509_NAME_ENTRY_get_object(x509_name_entry) 53 backend.openssl_assert(obj != backend._ffi.NULL) [all …]
|
D | aead.py | 27 def _aead_setup(backend, cipher_name, key, nonce, tag, tag_len, operation): argument 28 evp_cipher = backend._lib.EVP_get_cipherbyname(cipher_name) 29 backend.openssl_assert(evp_cipher != backend._ffi.NULL) 30 ctx = backend._lib.EVP_CIPHER_CTX_new() 31 ctx = backend._ffi.gc(ctx, backend._lib.EVP_CIPHER_CTX_free) 32 res = backend._lib.EVP_CipherInit_ex( 34 backend._ffi.NULL, 35 backend._ffi.NULL, 36 backend._ffi.NULL, 39 backend.openssl_assert(res != 0) [all …]
|
D | rsa.py | 38 def _enc_dec_rsa(backend, key, data, padding): argument 43 padding_enum = backend._lib.RSA_PKCS1_PADDING 45 padding_enum = backend._lib.RSA_PKCS1_OAEP_PADDING 53 if not backend.rsa_padding_supported(padding): 68 return _enc_dec_rsa_pkey_ctx(backend, key, data, padding_enum, padding) 71 def _enc_dec_rsa_pkey_ctx(backend, key, data, padding_enum, padding): argument 73 init = backend._lib.EVP_PKEY_encrypt_init 74 crypt = backend._lib.EVP_PKEY_encrypt 76 init = backend._lib.EVP_PKEY_decrypt_init 77 crypt = backend._lib.EVP_PKEY_decrypt [all …]
|
D | utils.py | 14 def _evp_pkey_derive(backend, evp_pkey, peer_public_key): argument 15 ctx = backend._lib.EVP_PKEY_CTX_new(evp_pkey, backend._ffi.NULL) 16 backend.openssl_assert(ctx != backend._ffi.NULL) 17 ctx = backend._ffi.gc(ctx, backend._lib.EVP_PKEY_CTX_free) 18 res = backend._lib.EVP_PKEY_derive_init(ctx) 19 backend.openssl_assert(res == 1) 20 res = backend._lib.EVP_PKEY_derive_set_peer( 23 backend.openssl_assert(res == 1) 24 keylen = backend._ffi.new("size_t *") 25 res = backend._lib.EVP_PKEY_derive(ctx, backend._ffi.NULL, keylen) [all …]
|
/external/python/cryptography/tests/hazmat/backends/ |
D | test_openssl.py | 20 from cryptography.hazmat.backends.openssl.backend import ( 21 Backend, backend 60 assert backend 72 backend.openssl_version_text().startswith("OpenSSL") or 73 backend.openssl_version_text().startswith("LibreSSL") 77 assert backend.openssl_version_number() > 0 80 assert backend.cipher_supported(None, None) is False 84 backend.register_cipher_adapter(AES, CBC, None) 92 lambda backend, cipher, mode: backend._ffi.NULL 95 DummyCipherAlgorithm(), mode, backend=b, [all …]
|
/external/tensorflow/tensorflow/python/keras/ |
D | backend_test.py | 37 from tensorflow.python.keras import backend 66 backend.variable(inputs, dtype=dtype), *keras_args, **keras_kwargs) 67 keras_output = backend.eval(keras_output) 93 backend.variable(input_a, dtype=dtype), 94 backend.variable(input_b, dtype=dtype), *keras_args, **keras_kwargs) 95 keras_output = backend.eval(keras_output) 111 sess = backend.get_session() 116 backend.clear_session() 119 sess = backend.get_session() 124 backend.clear_session() [all …]
|
/external/python/cryptography/tests/hazmat/primitives/ |
D | test_kbkdf.py | 24 def test_invalid_key(self, backend): argument 27 None, backend=backend) 33 None, backend=backend) 38 def test_already_finalized(self, backend): argument 41 None, backend=backend) 50 None, backend=backend) 59 None, backend=backend) 65 def test_key_length(self, backend): argument 68 None, backend=backend) 73 def test_rlen(self, backend): argument [all …]
|
D | test_serialization.py | 48 def test_load_der_rsa_private_key(self, key_path, password, backend): argument 53 key = load_der_private_key(bytearray(data), password, backend) 75 def test_load_pem_rsa_private_key(self, key_path, password, backend): argument 80 key = load_pem_private_key(bytearray(data), password, backend) 98 def test_load_der_rsa_private_key(self, key_path, password, backend): argument 102 derfile.read(), password, backend 120 def test_load_der_dsa_private_key(self, key_path, password, backend): argument 124 derfile.read(), password, backend 139 def test_password_not_bytes(self, key_path, backend): argument 147 derfile.read(), password, backend [all …]
|
D | test_hkdf.py | 26 def test_length_limit(self, backend): argument 35 backend=backend 38 def test_already_finalized(self, backend): argument 44 backend=backend 57 backend=backend 70 backend=backend 73 def test_verify(self, backend): argument 79 backend=backend 84 def test_verify_invalid(self, backend): argument 90 backend=backend [all …]
|
D | test_rsa.py | 107 def _skip_pss_hash_algorithm_unsupported(backend, hash_alg): argument 108 if not backend.rsa_padding_supported( 120 def test_skip_pss_hash_algorithm_unsupported(backend): argument 122 _skip_pss_hash_algorithm_unsupported(backend, DummyHashAlgorithm()) 155 def test_generate_rsa_keys(self, backend, public_exponent, key_size): argument 156 skey = rsa.generate_private_key(public_exponent, key_size, backend) 163 def test_generate_bad_public_exponent(self, backend): argument 167 backend=backend) 172 backend=backend) 174 def test_cant_generate_insecure_tiny_key(self, backend): argument [all …]
|
D | test_keywrap.py | 31 only_if=lambda backend: backend.cipher_supported( 37 def test_wrap(self, backend, params): argument 40 wrapped_key = keywrap.aes_key_wrap(wrapping_key, key_to_wrap, backend) 52 only_if=lambda backend: backend.cipher_supported( 58 def test_unwrap(self, backend, params): argument 63 keywrap.aes_key_unwrap(wrapping_key, wrapped_key, backend) 66 wrapping_key, wrapped_key, backend 71 only_if=lambda backend: backend.cipher_supported( 77 def test_wrap_invalid_key_length(self, backend): argument 80 keywrap.aes_key_wrap(b"badkey", b"sixteen_byte_key", backend) [all …]
|
D | test_aes.py | 20 only_if=lambda backend: backend.cipher_supported( 39 def test_xts_vectors(self, vector, backend): argument 44 cipher = base.Cipher(algorithms.AES(key), modes.XTS(tweak), backend) 54 only_if=lambda backend: backend.cipher_supported( 87 only_if=lambda backend: backend.cipher_supported( 120 only_if=lambda backend: backend.cipher_supported( 153 only_if=lambda backend: backend.cipher_supported( 186 only_if=lambda backend: backend.cipher_supported( 219 only_if=lambda backend: backend.cipher_supported( 236 only_if=lambda backend: backend.cipher_supported( [all …]
|
D | test_ec.py | 42 def _skip_ecdsa_vector(backend, curve_type, hash_type): argument 43 if not backend.elliptic_curve_signature_algorithm_supported( 54 def _skip_curve_unsupported(backend, curve): argument 55 if not backend.elliptic_curve_supported(curve): 58 curve.name, backend 63 def _skip_exchange_algorithm_unsupported(backend, algorithm, curve): argument 64 if not backend.elliptic_curve_exchange_algorithm_supported( 69 curve.name, backend 86 def test_skip_curve_unsupported(backend): argument 88 _skip_curve_unsupported(backend, DummyCurve()) [all …]
|
D | test_cmac.py | 45 only_if=lambda backend: backend.cmac_algorithm_supported( 50 def test_aes_generate(self, backend, params): argument 55 cmac = CMAC(AES(binascii.unhexlify(key)), backend) 60 only_if=lambda backend: backend.cmac_algorithm_supported( 65 def test_aes_verify(self, backend, params): argument 70 cmac = CMAC(AES(binascii.unhexlify(key)), backend) 75 only_if=lambda backend: backend.cmac_algorithm_supported( 80 def test_3des_generate(self, backend, params): argument 90 cmac = CMAC(TripleDES(binascii.unhexlify(key)), backend) 95 only_if=lambda backend: backend.cmac_algorithm_supported( [all …]
|
D | test_concatkdf.py | 25 def test_length_limit(self, backend): argument 29 ConcatKDFHash(hashes.SHA256(), big_length, None, backend) 31 def test_already_finalized(self, backend): argument 32 ckdf = ConcatKDFHash(hashes.SHA256(), 16, None, backend) 39 def test_derive(self, backend): argument 51 ckdf = ConcatKDFHash(hashes.SHA256(), 16, oinfo, backend) 55 def test_buffer_protocol(self, backend): argument 67 ckdf = ConcatKDFHash(hashes.SHA256(), 16, oinfo, backend) 71 def test_verify(self, backend): argument 83 ckdf = ConcatKDFHash(hashes.SHA256(), 16, oinfo, backend) [all …]
|
D | test_hmac.py | 23 only_if=lambda backend: backend.hmac_supported(hashes.MD5()), 35 def test_hmac_reject_unicode(self, backend): argument 36 h = hmac.HMAC(b"mykey", hashes.SHA1(), backend=backend) 40 def test_hmac_algorithm_instance(self, backend): argument 42 hmac.HMAC(b"key", hashes.SHA1, backend=backend) 44 def test_raises_after_finalize(self, backend): argument 45 h = hmac.HMAC(b"key", hashes.SHA1(), backend=backend) 57 def test_verify(self, backend): argument 58 h = hmac.HMAC(b'', hashes.SHA1(), backend=backend) 61 h = hmac.HMAC(b'', hashes.SHA1(), backend=backend) [all …]
|
D | utils.py | 43 def test_encryption(self, backend, params): argument 44 encrypt_test(backend, cipher_factory, mode_factory, params) 49 def encrypt_test(backend, cipher_factory, mode_factory, params): argument 50 assert backend.cipher_supported( 59 backend=backend 76 def test_aead(self, backend, params): argument 77 aead_test(backend, cipher_factory, mode_factory, params) 82 def aead_test(backend, cipher_factory, mode_factory, params): argument 93 backend 104 backend [all …]
|
D | test_hash_vectors.py | 20 only_if=lambda backend: backend.hash_supported(hashes.SHA1()), 37 only_if=lambda backend: backend.hash_supported(hashes.SHA224()), 54 only_if=lambda backend: backend.hash_supported(hashes.SHA256()), 71 only_if=lambda backend: backend.hash_supported(hashes.SHA384()), 88 only_if=lambda backend: backend.hash_supported(hashes.SHA512()), 105 only_if=lambda backend: backend.hash_supported(hashes.SHA512_224()), 122 only_if=lambda backend: backend.hash_supported(hashes.SHA512_256()), 139 only_if=lambda backend: backend.hash_supported(hashes.MD5()), 155 only_if=lambda backend: backend.hash_supported( 172 only_if=lambda backend: backend.hash_supported( [all …]
|
D | test_hashes.py | 22 def test_hash_reject_unicode(self, backend): argument 23 m = hashes.Hash(hashes.SHA1(), backend=backend) 27 def test_hash_algorithm_instance(self, backend): argument 29 hashes.Hash(hashes.SHA1, backend=backend) 31 def test_raises_after_finalize(self, backend): argument 32 h = hashes.Hash(hashes.SHA1(), backend=backend) 44 def test_unsupported_hash(self, backend): argument 46 hashes.Hash(DummyHashAlgorithm(), backend) 50 only_if=lambda backend: backend.hash_supported(hashes.SHA1()), 62 only_if=lambda backend: backend.hash_supported(hashes.SHA224()), [all …]
|
/external/python/cryptography/tests/ |
D | test_fernet.py | 48 only_if=lambda backend: backend.cipher_supported( 57 def test_generate(self, secret, now, iv, src, token, backend): argument 58 f = Fernet(secret.encode("ascii"), backend=backend) 69 def test_verify(self, secret, now, src, ttl_sec, token, backend, argument 71 f = Fernet(secret.encode("ascii"), backend=backend) 78 def test_invalid(self, secret, token, now, ttl_sec, backend, monkeypatch): argument 79 f = Fernet(secret.encode("ascii"), backend=backend) 85 def test_invalid_start_byte(self, backend): argument 86 f = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend) 90 def test_timestamp_too_short(self, backend): argument [all …]
|
/external/python/cryptography/tests/hazmat/primitives/twofactor/ |
D | test_totp.py | 26 only_if=lambda backend: backend.hmac_supported(hashes.SHA1()), 31 def test_generate_sha1(self, backend, params): argument 36 totp = TOTP(secret, 8, hashes.SHA1(), 30, backend) 40 only_if=lambda backend: backend.hmac_supported(hashes.SHA256()), 45 def test_generate_sha256(self, backend, params): argument 50 totp = TOTP(secret, 8, hashes.SHA256(), 30, backend) 54 only_if=lambda backend: backend.hmac_supported(hashes.SHA512()), 59 def test_generate_sha512(self, backend, params): argument 64 totp = TOTP(secret, 8, hashes.SHA512(), 30, backend) 68 only_if=lambda backend: backend.hmac_supported(hashes.SHA1()), [all …]
|
D | test_hotp.py | 27 only_if=lambda backend: backend.hmac_supported(hashes.SHA1()), 32 def test_invalid_key_length(self, backend): argument 36 HOTP(secret, 6, SHA1(), backend) 38 def test_unenforced_invalid_kwy_length(self, backend): argument 40 HOTP(secret, 6, SHA1(), backend, enforce_key_length=False) 42 def test_invalid_hotp_length(self, backend): argument 46 HOTP(secret, 4, SHA1(), backend) 48 def test_invalid_algorithm(self, backend): argument 52 HOTP(secret, 6, MD5(), backend) 55 def test_truncate(self, backend, params): argument [all …]
|
/external/llvm-project/llvm/utils/ |
D | llvm-gisel-cov.py | 17 backend, sep, value = s.partition('=') 20 if not backend: 24 return backend, int(value) 41 backend, _, data = data.partition('\0') 42 pos += len(backend) 45 if len(backend) == 0: 47 backend, = struct.unpack("%ds" % len(backend), backend) 57 covered_rules[backend] = covered_rules.get(backend, {}) 58 covered_rules[backend][rule_id] = covered_rules[backend].get(rule_id, 0) + 1 61 for backend, rules_for_backend in covered_rules.items(): [all …]
|
/external/curl/lib/vtls/ |
D | mbedtls.c | 203 struct ssl_backend_data *backend = connssl->backend; in set_ssl_version_min_max() local 235 mbedtls_ssl_conf_min_version(&backend->config, MBEDTLS_SSL_MAJOR_VERSION_3, in set_ssl_version_min_max() 237 mbedtls_ssl_conf_max_version(&backend->config, MBEDTLS_SSL_MAJOR_VERSION_3, in set_ssl_version_min_max() 249 struct ssl_backend_data *backend = connssl->backend; in mbed_connect_step1() local 275 mbedtls_ctr_drbg_init(&backend->ctr_drbg); in mbed_connect_step1() 277 ret = mbedtls_ctr_drbg_seed(&backend->ctr_drbg, entropy_func_mutex, in mbed_connect_step1() 287 mbedtls_entropy_init(&backend->entropy); in mbed_connect_step1() 288 mbedtls_ctr_drbg_init(&backend->ctr_drbg); in mbed_connect_step1() 290 ret = mbedtls_ctr_drbg_seed(&backend->ctr_drbg, mbedtls_entropy_func, in mbed_connect_step1() 291 &backend->entropy, NULL, 0); in mbed_connect_step1() [all …]
|