History log of /libcore/support/src/test/java/tests/security/MessageDigestTest.java
Revision Date Author Comments
420ea38aecdef0f5895c5e82751ebabe26bc0bd5 05-Feb-2016 Kenny Root <kroot@google.com> Fix AlgorithmParameter tests to have better errors

The previous test was catching all the exceptions and printing out the
message of the exception which erased all the useful information.

Bug: 26413503
Change-Id: Id4c9f6db59d19b67c2f4e098fbe79587fcbabb34
4155a2498a57fb09e92815f8993a70c216ddc5ec 02-Feb-2011 Brian Carlstrom <bdc@google.com> Performance improvements to NativeCrypto based MessageDigest API

NativeCrypto API improvements:
- Move to using EVP_MD related native methods, some of which are derived
from the EVP_MD_CTX versions with similar name. The new
EVP_get_digestbyname allows one time lookup of the EVP_MD from the
string name, avoiding doing it on every call to EVP_DigestInit.
- EVP_MD_CTX_create is now removed, it is just done as part of
EVP_DigestInit and EVP_VerifyInit to an extra JNI call.
- EVP_DigestFinal now destroys the EVP_MD_CTX to avoid needing to make
another call JNI call to EVP_MD_CTX_destroy. EVP_MD_CTX_destroy is
kept for cases when EVP_DigestFinal is never called.

luni/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java

In addition to the improved NativeCrypto API to allow better
performance for callers, the implementations use of
throwExceptionIfNecessary was made conditional based on the status
code from various operations, which had a noticeable impact on
performance compared to android.security.MessageDigest

luni/src/main/native/NativeCrypto.cpp

Updated MessageDigest.getInstance default implementation to use new
NativeCrypto API. An EVP_MD instance is looked up at class load time
for a specific digest type and then used to call
NativeCrypto.EVP_DigestInit as needed, avoiding a lookup of EVP_MD for
each new digest. The EVP_MD is also for a one-time lookup the digest
output size in bytes, to avoid native calls for
engineGetDigestLength. Finally, the creation of the EVP_MD_CTX is now
lazy, only created when needed, avoiding unnecessarily create/free in
reset cases such as engineDigest. See also external/bouncycastle's
OpenSSLDigest implementation which had similar optimizations.

luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLMessageDigestJDK.java

OpenSSLSignature also used EVP_MD_CTX_create, and its EVP_VerifyInit
was changed similar to EVP_DigestInit to internally allocate the
EVP_MD_CTX on the call to init.

luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSignature.java

Fix test to work with arbitrary provider order

luni/src/test/java/org/apache/harmony/security/tests/java/security/MessageDigest2Test.java

Fix CloseGuard warnings

luni/src/test/java/tests/security/MessageDigestTest.java

Bug: 3392028
Change-Id: Idb266ebc0918ffd5550e0f457784256400cd2ff0
f979bbd1277c77ca945ad981e7864fb4e9f6ae05 25-Jun-2010 Jesse Wilson <jessewilson@google.com> Scrubbing tests marked @BrokenTest.

This rearranges the security test support infrastructure. We no longer
rely on many top-level classes defined in CipherHelper.java to provide
test support. Instead these each have their own top level class in our
test support package: support/src/test/java/tests/security. Similarly
for abstract classes intended to be subclassed by cipher-specific
tests.

Other test methods that were duplicated in Harmony have been removed.
We need to pay closer attention to Harmony failures because they are
now our only source of coverage for some of these tests.

Change-Id: I1a1ca8a046bc9b6a33d5fa3f55fecc0d39f72c16