[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Wed Mar 4 14:04:46 UTC 2015


The branch master has been updated
       via  618be04e407a7800a7198ac87fa5e8cee7c6e10b (commit)
      from  28a00bcd8e318da18031b2ac8778c64147cd54f9 (commit)


- Log -----------------------------------------------------------------
commit 618be04e407a7800a7198ac87fa5e8cee7c6e10b
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Sun Mar 1 15:38:56 2015 +0000

    add RIPEMD160 whirlpool tests
    
    Add RIPEMD160 and whirlpool test data.
    Add Count keyword to repeatedly call EVP_DigestUpate.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 crypto/evp/evp_test.c   | 17 +++++++++++++--
 crypto/evp/evptests.txt | 56 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/crypto/evp/evp_test.c b/crypto/evp/evp_test.c
index cc7036a..1b17f64 100644
--- a/crypto/evp/evp_test.c
+++ b/crypto/evp/evp_test.c
@@ -534,6 +534,8 @@ struct digest_data {
     /* Input to digest */
     unsigned char *input;
     size_t input_len;
+    /* Repeat count for input */
+    size_t nrpt;
     /* Expected output */
     unsigned char *output;
     size_t output_len;
@@ -556,6 +558,7 @@ static int digest_test_init(struct evp_test *t, const char *alg)
     mdat->digest = digest;
     mdat->input = NULL;
     mdat->output = NULL;
+    mdat->nrpt = 1;
     t->data = mdat;
     return 1;
 }
@@ -575,12 +578,20 @@ static int digest_test_parse(struct evp_test *t,
         return test_bin(value, &mdata->input, &mdata->input_len);
     if (!strcmp(keyword, "Output"))
         return test_bin(value, &mdata->output, &mdata->output_len);
+    if (!strcmp(keyword, "Count")) {
+        long nrpt = atoi(value);
+        if (nrpt <= 0)
+            return 0;
+        mdata->nrpt = (size_t)nrpt;
+        return 1;
+    }
     return 0;
 }
 
 static int digest_test_run(struct evp_test *t)
 {
     struct digest_data *mdata = t->data;
+    size_t i;
     const char *err = "INTERNAL_ERROR";
     EVP_MD_CTX *mctx;
     unsigned char md[EVP_MAX_MD_SIZE];
@@ -592,8 +603,10 @@ static int digest_test_run(struct evp_test *t)
     if (!EVP_DigestInit_ex(mctx, mdata->digest, NULL))
         goto err;
     err = "DIGESTUPDATE_ERROR";
-    if (!EVP_DigestUpdate(mctx, mdata->input, mdata->input_len))
-        goto err;
+    for (i = 0; i < mdata->nrpt; i++) {
+        if (!EVP_DigestUpdate(mctx, mdata->input, mdata->input_len))
+            goto err;
+    }
     err = "DIGESTFINAL_ERROR";
     if (!EVP_DigestFinal(mctx, md, &md_len))
         goto err;
diff --git a/crypto/evp/evptests.txt b/crypto/evp/evptests.txt
index 91fb7dc..8bf90d0 100644
--- a/crypto/evp/evptests.txt
+++ b/crypto/evp/evptests.txt
@@ -60,6 +60,62 @@ Digest = MD4
 Input = "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
 Output = e33b4ddc9c38f2199c3e7b164fcc0536
 
+# RIPEMD160 tests from rmdtest.c
+Digest = RIPEMD160
+Input = ""
+Output = 9c1185a5c5e9fc54612808977ee8f548b2258d31
+Digest = RIPEMD160
+Input = "a"
+Output = 0bdc9d2d256b3ee9daae347be6f4dc835a467ffe
+Digest = RIPEMD160
+Input = "abc"
+Output = 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc
+Digest = RIPEMD160
+Input = "message digest"
+Output = 5d0689ef49d2fae572b881b123a85ffa21595f36
+Digest = RIPEMD160
+Input = "abcdefghijklmnopqrstuvwxyz"
+Output = f71c27109c692c1b56bbdceb5b9d2865b3708dbc
+Digest = RIPEMD160
+Input = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
+Output = 12a053384a9c0c88e405a06c27dcf49ada62eb2b
+Digest = RIPEMD160
+Input = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
+Output = b0e20b6e3116640286ed3a87a5713079b21f5189
+Digest = RIPEMD160
+Input = "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+Output = 9b752e45573d4b39f4dbd3323cab82bf63326bfb
+
+# whirlpool tests from wp_test.c
+Digest = whirlpool
+Input = ""
+Output = 19FA61D75522A4669B44E39C1D2E1726C530232130D407F89AFEE0964997F7A73E83BE698B288FEBCF88E3E03C4F0757EA8964E59B63D93708B138CC42A66EB3
+Digest = whirlpool
+Input = "a"
+Output = 8ACA2602792AEC6F11A67206531FB7D7F0DFF59413145E6973C45001D0087B42D11BC645413AEFF63A42391A39145A591A92200D560195E53B478584FDAE231A
+Digest = whirlpool
+Input = "abc"
+Output = 4E2448A4C6F486BB16B6562C73B4020BF3043E3A731BCE721AE1B303D97E6D4C7181EEBDB6C57E277D0E34957114CBD6C797FC9D95D8B582D225292076D4EEF5
+Digest = whirlpool
+Input = "message digest"
+Output = 378C84A4126E2DC6E56DCC7458377AAC838D00032230F53CE1F5700C0FFB4D3B8421557659EF55C106B4B52AC5A4AAA692ED920052838F3362E86DBD37A8903E
+Digest = whirlpool
+Input = "abcdefghijklmnopqrstuvwxyz"
+Output = F1D754662636FFE92C82EBB9212A484A8D38631EAD4238F5442EE13B8054E41B08BF2A9251C30B6A0B8AAE86177AB4A6F68F673E7207865D5D9819A3DBA4EB3B
+Digest = whirlpool
+Input = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
+Output = DC37E008CF9EE69BF11F00ED9ABA26901DD7C28CDEC066CC6AF42E40F82F3A1E08EBA26629129D8FB7CB57211B9281A65517CC879D7B962142C65F5A7AF01467
+Digest = whirlpool
+Input = "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+Output = 466EF18BABB0154D25B9D38A6414F5C08784372BCCB204D6549C4AFADB6014294D5BD8DF2A6C44E538CD047B2681A51A2C60481E88C5A20B2C2A80CF3A9A083B
+Digest = whirlpool
+Input = "abcdbcdecdefdefgefghfghighijhijk"
+Output = 2A987EA40F917061F5D6F0A0E4644F488A7A5A52DEEE656207C562F988E95C6916BDC8031BC5BE1B7B947639FE050B56939BAAA0ADFF9AE6745B7B181C3BE3FD
+Digest = whirlpool
+Input = "aaaaaaaaaa"
+Count = 100000
+Output = 0C99005BEB57EFF50A7CF005560DDF5D29057FD86B20BFD62DECA0F1CCEA4AF51FC15490EDDC47AF32BB2B66C34FF9AD8C6008AD677F77126953B226E4ED8B01
+
 # AES 128 ECB tests (from FIPS-197 test vectors, encrypt)
 
 Cipher = AES-128-ECB


More information about the openssl-commits mailing list