HomeSort by relevance Sort by last modified time
    Searched refs:NativeCrypto (Results 1 - 25 of 53) sorted by null

1 2 3

  /libcore/crypto/src/main/java/org/conscrypt/
OpenSSLX509CRLEntry.java 40 NativeCrypto.get_X509_REVOKED_ext_oids(mContext,
41 NativeCrypto.EXTENSION_TYPE_CRITICAL);
49 && (NativeCrypto.get_X509_REVOKED_ext_oids(mContext,
50 NativeCrypto.EXTENSION_TYPE_NON_CRITICAL).length == 0)) {
59 return NativeCrypto.X509_REVOKED_get_ext_oid(mContext, oid);
65 NativeCrypto.get_X509_REVOKED_ext_oids(mContext,
66 NativeCrypto.EXTENSION_TYPE_NON_CRITICAL);
74 && (NativeCrypto.get_X509_REVOKED_ext_oids(mContext,
75 NativeCrypto.EXTENSION_TYPE_CRITICAL).length == 0)) {
85 NativeCrypto.get_X509_REVOKED_ext_oids(mContext
    [all...]
OpenSSLMac.java 30 NativeCrypto.EVP_MD_CTX_create());
88 macKey = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_mac_key(evp_pkey_type, keyBytes));
91 NativeCrypto.EVP_MD_CTX_init(ctx.getContext());
97 NativeCrypto.EVP_DigestSignInit(ctx.getContext(), evp_md, macKey.getPkeyContext());
108 NativeCrypto.EVP_DigestUpdate(ctx.getContext(), input, offset, len);
113 final byte[] output = NativeCrypto.EVP_DigestSignFinal(ctx.getContext());
124 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("md5");
125 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD);
128 super(EVP_MD, SIZE, NativeCrypto.EVP_PKEY_HMAC);
133 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("sha1")
    [all...]
OpenSSLMessageDigestJDK.java 76 NativeCrypto.EVP_DigestUpdate(getCtx(), input, offset, len);
82 NativeCrypto.EVP_DigestFinal(getCtx(), result, 0);
89 d.ctx = NativeCrypto.EVP_MD_CTX_copy(getCtx());
95 ctx = NativeCrypto.EVP_DigestInit(evp_md);
102 NativeCrypto.EVP_MD_CTX_destroy(ctx);
116 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("md5");
117 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD);
124 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("sha1");
125 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD);
132 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("sha256")
    [all...]
OpenSSLRandom.java 27 NativeCrypto.RAND_seed(seed);
32 NativeCrypto.RAND_bytes(bytes);
38 NativeCrypto.RAND_bytes(output);
OpenSSLECGroupContext.java 45 final long ctx = NativeCrypto.EC_GROUP_new_by_curve_name(curveName);
50 NativeCrypto.EC_GROUP_set_point_conversion_form(ctx,
51 NativeCrypto.POINT_CONVERSION_UNCOMPRESSED);
52 NativeCrypto.EC_GROUP_set_asn1_flag(ctx, NativeCrypto.OPENSSL_EC_NAMED_CURVE);
59 final long ctx = NativeCrypto.EC_GROUP_new_curve(type, p.toByteArray(), a.toByteArray(),
65 NativeCrypto.EC_GROUP_set_point_conversion_form(ctx,
66 NativeCrypto.POINT_CONVERSION_UNCOMPRESSED);
71 NativeCrypto.EC_POINT_new(ctx));
73 NativeCrypto.EC_POINT_set_affine_coordinates(ctx, generator.getContext()
    [all...]
OpenSSLX509CRL.java 58 final long crlCtx = NativeCrypto.d2i_X509_CRL_bio(bis.getBioContext());
66 NativeCrypto.BIO_free(bis.getBioContext());
76 certRefs = NativeCrypto.d2i_PKCS7_bio(bis.getBioContext(), NativeCrypto.PKCS7_CRLS);
80 NativeCrypto.BIO_free(bis.getBioContext());
97 final long crlCtx = NativeCrypto.PEM_read_bio_X509_CRL(bis.getBioContext());
105 NativeCrypto.BIO_free(bis.getBioContext());
115 certRefs = NativeCrypto.PEM_read_bio_PKCS7(bis.getBioContext(),
116 NativeCrypto.PKCS7_CRLS);
120 NativeCrypto.BIO_free(bis.getBioContext())
    [all...]
OpenSSLEngine.java 26 NativeCrypto.ENGINE_load_dynamic();
41 engineCtx = NativeCrypto.ENGINE_by_id(engine);
46 NativeCrypto.ENGINE_add(engineCtx);
55 if (NativeCrypto.ENGINE_init(engineCtx) == 0) {
56 NativeCrypto.ENGINE_free(engineCtx);
66 final long keyRef = NativeCrypto.ENGINE_load_private_key(ctx, id);
84 final long keyRef = NativeCrypto.ENGINE_load_private_key(ctx, id);
104 NativeCrypto.ENGINE_finish(ctx);
105 NativeCrypto.ENGINE_free(ctx);
127 final String id = NativeCrypto.ENGINE_get_id(ctx)
    [all...]
OpenSSLX509Certificate.java 65 final long certCtx = NativeCrypto.d2i_X509_bio(bis.getBioContext());
73 NativeCrypto.BIO_free(bis.getBioContext());
78 final long certCtx = NativeCrypto.d2i_X509(encoded);
92 certRefs = NativeCrypto.d2i_PKCS7_bio(bis.getBioContext(), NativeCrypto.PKCS7_CERTS);
96 NativeCrypto.BIO_free(bis.getBioContext());
120 final long certCtx = NativeCrypto.PEM_read_bio_X509(bis.getBioContext());
128 NativeCrypto.BIO_free(bis.getBioContext());
139 certRefs = NativeCrypto.PEM_read_bio_PKCS7(bis.getBioContext(),
140 NativeCrypto.PKCS7_CERTS)
    [all...]
OpenSSLKey.java 74 return new OpenSSLKey(NativeCrypto.d2i_PKCS8_PRIV_KEY_INFO(key.getEncoded()));
81 switch (NativeCrypto.EVP_PKEY_type(ctx)) {
82 case NativeCrypto.EVP_PKEY_RSA:
84 case NativeCrypto.EVP_PKEY_DSA:
86 case NativeCrypto.EVP_PKEY_EC:
99 key = new OpenSSLKey(NativeCrypto.d2i_PUBKEY(x509KeySpec.getEncoded()));
104 if (NativeCrypto.EVP_PKEY_type(key.getPkeyContext()) != type) {
116 switch (NativeCrypto.EVP_PKEY_type(ctx)) {
117 case NativeCrypto.EVP_PKEY_RSA:
119 case NativeCrypto.EVP_PKEY_DSA
    [all...]
OpenSSLCipherContext.java 33 NativeCrypto.EVP_CIPHER_CTX_cleanup(context);
OpenSSLDigestContext.java 33 NativeCrypto.EVP_MD_CTX_destroy(context);
OpenSSLECPointContext.java 35 NativeCrypto.EC_POINT_clear_free(pointCtx);
49 if (!NativeCrypto.EC_GROUP_cmp(group.getContext(), other.group.getContext())) {
53 return NativeCrypto.EC_POINT_cmp(group.getContext(), pointCtx, other.pointCtx);
57 final byte[][] generatorCoords = NativeCrypto.EC_POINT_get_affine_coordinates(
77 NativeCrypto.EC_POINT_new(group.getContext()));
78 NativeCrypto.EC_POINT_set_affine_coordinates(group.getContext(),
OpenSSLECPublicKey.java 48 final long origGroup = NativeCrypto.EC_KEY_get0_group(key.getPkeyContext());
49 this.group = new OpenSSLECGroupContext(NativeCrypto.EC_GROUP_dup(origGroup));
57 NativeCrypto.get_EC_GROUP_type(group.getContext()), group, ecKeySpec.getW());
58 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getContext(),
70 NativeCrypto.get_EC_GROUP_type(group.getContext()), group, ecPublicKey.getW());
71 return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getContext(),
90 return NativeCrypto.i2d_PUBKEY(key.getPkeyContext());
100 NativeCrypto.EC_KEY_get_public_key(key.getPkeyContext()));
146 return Arrays.hashCode(NativeCrypto.i2d_PUBKEY(key.getPkeyContext()));
151 return NativeCrypto.EVP_PKEY_print_public(key.getPkeyContext())
    [all...]
OpenSSLSecretKey.java 41 type = NativeCrypto.EVP_PKEY_HMAC;
42 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_mac_key(type, encoded));
49 type = NativeCrypto.EVP_PKEY_type(key.getPkeyContext());
55 return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_mac_key(NativeCrypto.EVP_PKEY_HMAC,
127 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_mac_key(type, encoded));
Platform.java 47 return NativeCrypto.OBJ_txt2nid_oid(algName);
52 return NativeCrypto.OBJ_txt2nid_longName(oid);
OpenSSLECPrivateKey.java 46 final long origGroup = NativeCrypto.EC_KEY_get0_group(key.getPkeyContext());
47 this.group = new OpenSSLECGroupContext(NativeCrypto.EC_GROUP_dup(origGroup));
55 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getContext(), 0,
67 return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getContext(), 0,
104 return NativeCrypto.i2d_PKCS8_PRIV_KEY_INFO(key.getPkeyContext());
122 return new BigInteger(NativeCrypto.EC_KEY_get_private_key(key.getPkeyContext()));
161 return Arrays.hashCode(NativeCrypto.i2d_PKCS8_PRIV_KEY_INFO(key.getPkeyContext()));
166 return NativeCrypto.EVP_PKEY_print_private(key.getPkeyContext());
174 key = new OpenSSLKey(NativeCrypto.d2i_PKCS8_PRIV_KEY_INFO(encoded));
176 final long origGroup = NativeCrypto.EC_KEY_get0_group(key.getPkeyContext())
    [all...]
OpenSSLSignature.java 97 ctx = NativeCrypto.EVP_SignInit(evpAlgorithm);
103 NativeCrypto.EVP_SignUpdate(ctx, input, offset, len);
107 ctx = NativeCrypto.EVP_VerifyInit(evpAlgorithm);
113 NativeCrypto.EVP_VerifyUpdate(ctx, input, offset, len);
123 final int pkeyType = NativeCrypto.EVP_PKEY_type(pkey.getPkeyContext());
127 if (pkeyType != NativeCrypto.EVP_PKEY_RSA) {
132 if (pkeyType != NativeCrypto.EVP_PKEY_DSA) {
137 if (pkeyType != NativeCrypto.EVP_PKEY_EC) {
234 byte[] buffer = new byte[NativeCrypto.EVP_PKEY_size(key.getPkeyContext())];
235 int bytesWritten = NativeCrypto.EVP_SignFinal(ctx, buffer, 0, key.getPkeyContext())
    [all...]
OpenSSLSocketImpl.java 65 implements NativeCrypto.SSLHandshakeCallbacks {
179 NativeCrypto.getDefaultProtocols(),
180 NativeCrypto.getDefaultCipherSuites());
260 final int seedLengthInBytes = NativeCrypto.RAND_SEED_LENGTH_IN_BYTES;
263 NativeCrypto.RAND_load_file("/dev/urandom", seedLengthInBytes);
265 NativeCrypto.RAND_seed(secureRandom.generateSeed(seedLengthInBytes));
277 sslNativePointer = NativeCrypto.SSL_new(sslCtxNativePointer);
281 NativeCrypto.SSL_CTX_enable_npn(sslCtxNativePointer);
285 NativeCrypto.SSL_CTX_set_alpn_protos(sslCtxNativePointer, alpnProtocols);
293 if (enabledCipherSuite.equals(NativeCrypto.TLS_EMPTY_RENEGOTIATION_INFO_SCSV))
    [all...]
OpenSSLRSAPublicKey.java 50 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_RSA(
66 return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_RSA(
92 return NativeCrypto.i2d_PUBKEY(key.getPkeyContext());
100 byte[][] params = NativeCrypto.get_RSA_public_params(key.getPkeyContext());
173 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_RSA(
OpenSSLServerSocketImpl.java 33 private String[] enabledProtocols = NativeCrypto.getSupportedProtocols();
34 private String[] enabledCipherSuites = NativeCrypto.getDefaultCipherSuites();
79 return NativeCrypto.getSupportedProtocols();
103 enabledProtocols = NativeCrypto.checkEnabledProtocols(protocols);
108 return NativeCrypto.getSupportedCipherSuites();
140 enabledCipherSuites = NativeCrypto.checkEnabledCipherSuites(suites);
200 if (enabledCipherSuite.equals(NativeCrypto.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) {
OpenSSLCipherRSA.java 81 private int padding = NativeCrypto.RSA_PKCS1_PADDING;
101 this.padding = NativeCrypto.RSA_PKCS1_PADDING;
105 this.padding = NativeCrypto.RSA_NO_PADDING;
130 if (padding == NativeCrypto.RSA_PKCS1_PADDING) {
141 return NativeCrypto.RSA_size(this.key.getPkeyContext());
187 buffer = new byte[NativeCrypto.RSA_size(this.key.getPkeyContext())];
250 if (padding == NativeCrypto.RSA_NO_PADDING) {
264 resultSize = NativeCrypto.RSA_private_encrypt(tmpBuf.length, tmpBuf, output,
267 resultSize = NativeCrypto.RSA_public_encrypt(tmpBuf.length, tmpBuf, output,
273 resultSize = NativeCrypto.RSA_private_decrypt(tmpBuf.length, tmpBuf, output
    [all...]
OpenSSLRSAPrivateKey.java 70 return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_RSA(
85 byte[][] params = NativeCrypto.get_RSA_private_params(key.getPkeyContext());
103 return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_RSA(
121 readParams(NativeCrypto.get_RSA_private_params(key.getPkeyContext()));
167 return NativeCrypto.i2d_PKCS8_PRIV_KEY_INFO(key.getPkeyContext());
251 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_RSA(
OpenSSLSignatureRawRSA.java 108 int maxSize = NativeCrypto.RSA_size(key.getPkeyContext());
126 int maxSize = NativeCrypto.RSA_size(key.getPkeyContext());
149 NativeCrypto.RSA_private_encrypt(inputOffset, inputBuffer, outputBuffer,
150 key.getPkeyContext(), NativeCrypto.RSA_PKCS1_PADDING);
174 resultSize = NativeCrypto.RSA_public_decrypt(sigBytes.length, sigBytes,
175 outputBuffer, key.getPkeyContext(), NativeCrypto.RSA_PKCS1_PADDING);
  /external/bouncycastle/bcprov/src/main/java/org/bouncycastle/crypto/digests/
OpenSSLDigest.java 19 import com.android.org.conscrypt.NativeCrypto;
92 NativeCrypto.EVP_DigestUpdate(getCtx(), in, inOff, len);
96 int i = NativeCrypto.EVP_DigestFinal(getCtx(), out, outOff);
104 ctx = NativeCrypto.EVP_DigestInit(evp_md);
111 NativeCrypto.EVP_MD_CTX_destroy(ctx);
126 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("md5");
127 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD);
128 private static final int BLOCK_SIZE = NativeCrypto.EVP_MD_block_size(EVP_MD);
133 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("sha1");
134 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD)
    [all...]
  /libcore/crypto/src/test/java/org/conscrypt/
NativeCryptoTest.java 55 import org.conscrypt.NativeCrypto.SSLHandshakeCallbacks;
56 import static org.conscrypt.NativeCrypto.SSL_MODE_HANDSHAKE_CUTTHROUGH;
79 assertEquals(0, NativeCrypto.ERR_peek_last_error());
119 SERVER_CERTIFICATES = NativeCrypto.encodeCertificates(
125 CLIENT_CERTIFICATES = NativeCrypto.encodeCertificates(
159 assertEqualByteArrays(NativeCrypto.SSL_SESSION_session_id(expected),
160 NativeCrypto.SSL_SESSION_session_id(actual));
178 NativeCrypto.EVP_PKEY_cmp(NULL, NULL);
194 pkey1 = NativeCrypto.EVP_PKEY_new_RSA(privKey1.getModulus().toByteArray(),
204 pkey1_copy = NativeCrypto.EVP_PKEY_new_RSA(privKey1.getModulus().toByteArray()
    [all...]

Completed in 194 milliseconds

1 2 3