diff libtomcrypt/testprof/rsa_test.c @ 1435:f849a5ca2efc

update to libtomcrypt 1.17 (with Dropbear changes)
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 17:50:50 +0800
parents 0cbe8f6dbf9e
children
line wrap: on
line diff
--- a/libtomcrypt/testprof/rsa_test.c	Sat Jun 24 11:53:32 2017 +0800
+++ b/libtomcrypt/testprof/rsa_test.c	Sat Jun 24 17:50:50 2017 +0800
@@ -1,6 +1,6 @@
 #include <tomcrypt_test.h>
 
-#ifdef MRSA 
+#ifdef LTC_MRSA 
 
 #define RSA_MSGSIZE 78
 
@@ -137,7 +137,7 @@
    hash_idx = find_hash("sha1");
    prng_idx = find_prng("yarrow");
    if (hash_idx == -1 || prng_idx == -1) {
-      fprintf(stderr, "rsa_test requires SHA1 and yarrow");
+      fprintf(stderr, "rsa_test requires LTC_SHA1 and yarrow");
       return 1;
    }
    
@@ -257,14 +257,14 @@
       }
    }
 
-   /* encrypt the key PKCS #1 v1.5 (payload from 1 to 117 bytes) */
+   /* encrypt the key LTC_PKCS #1 v1.5 (payload from 1 to 117 bytes) */
    for (rsa_msgsize = 1; rsa_msgsize <= 117; rsa_msgsize++) {
       len  = sizeof(out);
       len2 = rsa_msgsize;
-      DO(rsa_encrypt_key_ex(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, 0, LTC_PKCS_1_V1_5, &key));
+      DO(rsa_encrypt_key_ex(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, 0, LTC_LTC_PKCS_1_V1_5, &key));
 
       len2 = rsa_msgsize;
-      DO(rsa_decrypt_key_ex(out, len, tmp, &len2, NULL, 0, 0, LTC_PKCS_1_V1_5, &stat, &key));
+      DO(rsa_decrypt_key_ex(out, len, tmp, &len2, NULL, 0, 0, LTC_LTC_PKCS_1_V1_5, &stat, &key));
       if (!(stat == 1 && stat2 == 0)) {
          fprintf(stderr, "rsa_decrypt_key_ex failed, %d, %d", stat, stat2);
          return 1;
@@ -349,13 +349,13 @@
       return 1;
    }
    
-   /* sign a message with PKCS #1 v1.5 */
+   /* sign a message with LTC_PKCS #1 v1.5 */
    len = sizeof(out);
-   DO(rsa_sign_hash_ex(in, 20, out, &len, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey));
-   DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat, &pubKey));
+   DO(rsa_sign_hash_ex(in, 20, out, &len, LTC_LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey));
+   DO(rsa_verify_hash_ex(out, len, in, 20, LTC_LTC_PKCS_1_V1_5, hash_idx, 8, &stat, &pubKey));
    /* change a byte */
    in[0] ^= 1;
-   DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat2, &pubKey));
+   DO(rsa_verify_hash_ex(out, len, in, 20, LTC_LTC_PKCS_1_V1_5, hash_idx, 8, &stat2, &pubKey));
    
    if (!(stat == 1 && stat2 == 0)) {
       fprintf(stderr, "rsa_verify_hash_ex failed, %d, %d", stat, stat2);
@@ -382,6 +382,6 @@
 
 #endif
 
-/* $Source: /cvs/libtom/libtomcrypt/testprof/rsa_test.c,v $ */
-/* $Revision: 1.18 $ */
-/* $Date: 2006/11/21 00:10:18 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */