History log of /external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
49ebea12f4954f3dbcd16a33a8fa98532d29f8c9 22-Dec-2015 Alex Klyubin <klyubin@google.com> Fix sanity checks around direct ByteBuffer memory access.

This fixes the sanity checks around access to memory backing direct
BytBuffer instances. The previous checks would've erronously failed
if pointers crossed the 2^63 boundary. There is no need for check for
pointer overflow.

Bug: 24674857
Change-Id: Ic8b5a651418c401d32eb0c8053217988963cd326
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
67cf2fcd35de497bb4dd7a2cc9bf2a02f0b06349 06-Nov-2015 Alex Klyubin <klyubin@google.com> Adjust names of digest-related NativeCrypto methods.

This adjusts the names of digest-related NativeCrypto methods to match
the names of underlying BoringSSL functions. This makes it easier to
reason about the functionality being invoked via NativeCrypto.

Change-Id: I04e2148ba818ae3e9ad60871b046052fcfffec4d
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
75d8933cc4b5053080612f44f9d975f659d933d2 02-Nov-2015 Alex Klyubin <klyubin@google.com> Speed up digesting by avoiding unnecessary operations.

Conscrypt's MessageDigest implementations at the end of computing a
digest create and initialize a new EVP_MD_CTX and then also intialize
the digest struct there. This is done because the MessageDigest
instance could be reused for a new digesting session.

This change implements three optimizations:
1. MessageDigestSpi now reuses its EVP_MD_CTX instead of creating a
new one for each new digesting session.
2. MessageDigestSpi now defers the initialization of the digest struct
in EVP_MD_CTX till the first invocation of
engineUpdate/engineDigest.
3. MessagDigestSpi (and SignatureSpi) no longer invoke EVP_MD_CTX_init
after EVP_MD_CTX_create because EVP_MD_CTX_create initializes the
EVP_MD_CTX it creates.

libcore's MessageDigestBenchmark on Nexus 5 shows:
* 10-15% faster performance for a single digest of 8192 bytes.
* 15-20% faster performance for reusing a MessageDigest instance to
compute a digest of 8192 bytes ten times.

Change-Id: I8a0697310ef7efcd4db6870e54eb46102fd4a941
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
c97e9654f16d2830a7ca268496f195d27cbc1b34 31-Oct-2015 Alex Klyubin <klyubin@google.com> Revert "Speed up digesting by avoiding unnecessary operations."

This reverts commit 5041dd13c9499e4154436ef1f105a3d5d46caa19.

This change broke a libcore test:
org.apache.harmony.security.tests.java.security.DigestInputStream2Test#test_onZ
java.lang.RuntimeException: Unable to copy EVP_MD_CTX
at com.android.org.conscrypt.NativeCrypto.EVP_MD_CTX_copy(Native Method)
at com.android.org.conscrypt.OpenSSLMessageDigestJDK.clone(OpenSSLMessageDigestJDK.java:200)
at java.security.MessageDigest$MessageDigestImpl.clone(MessageDigest.java:428)
at org.apache.harmony.security.tests.java.security.DigestInputStream2Test.test_onZ(DigestInputStream2Test.java:62)
org.apache.harmony.security.tests.java.security.DigestInputStream2Test#test_onZ FAIL (EXEC_FAILED)

Change-Id: Ib925bc0aadb633bbad4240f1d52bdb6676afc56f
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
5041dd13c9499e4154436ef1f105a3d5d46caa19 29-Oct-2015 Alex Klyubin <klyubin@google.com> Speed up digesting by avoiding unnecessary operations.

Conscrypt's MessageDigest implementations at the end of computing a
digest create and initialize a new EVP_MD_CTX and then also intialize
the digest struct there. This is done because the MessageDigest
instance could be reused for a new digesting session.

This change implements two optimizations:
1. MessageDigestImpl instance now reuses its EVP_MD_CTX instead of
creating a new one for each new digesting session.
2. MessageDigestImpl instance now defers the initialization of the
digest struct in EVP_MD_CTX till the first invocation of
engineUpdate/engineDigest.

libcore's MessageDigestBenchmark on Nexus 5 shows:
* 10-15% faster performance for a single digest of 8192 bytes.
* 15-20% faster performance for reusing a MessageDigest instance to
compute a digest of 8192 bytes ten times.

Change-Id: I0e476381321127642315355f848a1ba90114fe7d
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
91fd701b4587210b794fa1a537c38f306a3241d6 15-Oct-2015 Alex Klyubin <klyubin@google.com> Zero-copy digesting for direct ByteBuffer input.

Prior to this change, Conscrypt's MessageDigest.update(ByteBuffer)
invoked for a direct ByteBuffer resulted in the creation of a new
byte[] of size ByteBuffer.remaining() and the copying of the
ByteBuffer's contents into that array.

This change implements an optimization which avoids the allocation
and copying, by making BoringSSL EVP_DigestUpdate read directly from
the memory region represented by the direct ByteBuffer.

Change-Id: I112d318128402d1d78e226df9dfe54af55955953
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
4bff0a15ae03c8a3e1ae95590cc8c4240837bff6 25-Nov-2014 Kenny Root <kroot@google.com> Convert EVP_MD_CTX to new style

To avoid conflicts in the language spec and how Conscrypt does native
calls, we need to wrap all native references in a Java object reference.
Calling NativeCrypto's static native methods with a raw pointer doesn't
guarantee that the calling object won't be finalized during the method
running.

Bug: 16656908
Change-Id: I165e041a8fe056770d6ce6d6cd064c411575b7c4
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
88b56b0666fe3a702da4edc7b5b58266033c5871 16-May-2014 Kenny Root <kroot@google.com> OpenSSLMessageDigestJDK: support clone

Add the ability to clone the MessageDigest state.

Bug: 14821275
Change-Id: Ifa1b48db708448b971afe1e7360876f3fbe47588
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
652ff53bd48ed61389337a42d8e50cdb7ace0fec 24-Feb-2014 Kenny Root <kroot@google.com> Fix up concurrent use of APIs

Code that is incorrectly using MessageDigest, Signature, or Mac in
multiple threads simultaneously could cause a SEGV if OpenSSL is
clearing out the MD_CTX at the same time another thread is trying to
write to it. Make sure we initialize a new MD_CTX after each run to
avoid crashing. The program using the instances concurrently is still
wrong and will most likely get inconsistent results.

Switch to using a context object instance to make sure we can hold a
reference to the object during the native call.

Bug: 8787753
Change-Id: I2518613a47cf03c811a29d17040804fc708394dd
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
f06338c01394610174fe2b3532beac56d61d9e26 07-Nov-2013 Kenny Root <kroot@google.com> Random cleanups of old code style

Add @Override annotation, remove unused imports, and remove unnecessary
casts. Also make sure annotations are on a line by themselves.

Change-Id: I294b43353d7b1e77fd1c9d031af7b7062f024eee
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
d2db2c558ef6afc14d59f4a6b547598ff3973597 26-Sep-2013 Kenny Root <kroot@google.com> Conscrypt: add SHA-224 with tests

SHA-224 has made a comeback in the latest StandardNames documentation.
This change adds tests for SHA-224 and also Conscrypt providers for
things we have code paths to support.

Change-Id: I8c200082ff76ee4ae38b6efaa16e6741b33b7f5b
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java
860d2707ce126ef8f66e3eac7ceeab6d24218cd8 24-Apr-2013 Kenny Root <kroot@google.com> Move JSSE to new package

To help with shipping the JSSE with apps that want to bundle it, move
it to a new package so that the tangles in other parts of the library
can be untangled.

Change-Id: I810b6861388635301e28aee5b9b47b8e6b35b430
/external/conscrypt/src/main/java/org/conscrypt/OpenSSLMessageDigestJDK.java