diff libtomcrypt/src/pk/rsa/rsa_encrypt_key.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 6dba84798cd5
line wrap: on
line diff
--- a/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c	Sat Jun 24 11:53:32 2017 +0800
+++ b/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c	Sat Jun 24 17:50:50 2017 +0800
@@ -6,19 +6,19 @@
  * The library is free for all purposes without any express
  * guarantee it works.
  *
- * Tom St Denis, [email protected], http://libtomcrypt.com
+ * Tom St Denis, [email protected], http://libtom.org
  */
 #include "tomcrypt.h"
 
 /**
   @file rsa_encrypt_key.c
-  RSA PKCS #1 encryption, Tom St Denis and Andreas Lange
+  RSA LTC_PKCS #1 encryption, Tom St Denis and Andreas Lange
 */
 
-#ifdef MRSA
+#ifdef LTC_MRSA
 
 /**
-    (PKCS #1 v2.0) OAEP pad then encrypt
+    (LTC_PKCS #1 v2.0) OAEP pad then encrypt
     @param in          The plaintext
     @param inlen       The length of the plaintext (octets)
     @param out         [out] The ciphertext
@@ -28,7 +28,7 @@
     @param prng        An active PRNG
     @param prng_idx    The index of the desired prng
     @param hash_idx    The index of the desired hash
-    @param padding     Type of padding (LTC_PKCS_1_OAEP or LTC_PKCS_1_V1_5)
+    @param padding     Type of padding (LTC_LTC_PKCS_1_OAEP or LTC_LTC_PKCS_1_V1_5)
     @param key         The RSA key to encrypt to
     @return CRYPT_OK if successful
 */
@@ -46,8 +46,8 @@
   LTC_ARGCHK(key    != NULL);
 
   /* valid padding? */
-  if ((padding != LTC_PKCS_1_V1_5) &&
-      (padding != LTC_PKCS_1_OAEP)) {
+  if ((padding != LTC_LTC_PKCS_1_V1_5) &&
+      (padding != LTC_LTC_PKCS_1_OAEP)) {
     return CRYPT_PK_INVALID_PADDING;
   }
 
@@ -56,7 +56,7 @@
      return err;
   }
 
-  if (padding == LTC_PKCS_1_OAEP) {
+  if (padding == LTC_LTC_PKCS_1_OAEP) {
     /* valid hash? */
     if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) {
        return err;
@@ -73,7 +73,7 @@
      return CRYPT_BUFFER_OVERFLOW;
   }
 
-  if (padding == LTC_PKCS_1_OAEP) {
+  if (padding == LTC_LTC_PKCS_1_OAEP) {
     /* OAEP pad the key */
     x = *outlen;
     if ((err = pkcs_1_oaep_encode(in, inlen, lparam,
@@ -82,21 +82,21 @@
        return err;
     }
   } else {
-    /* PKCS #1 v1.5 pad the key */
+    /* LTC_PKCS #1 v1.5 pad the key */
     x = *outlen;
-    if ((err = pkcs_1_v1_5_encode(in, inlen, LTC_PKCS_1_EME,
+    if ((err = pkcs_1_v1_5_encode(in, inlen, LTC_LTC_PKCS_1_EME,
                                   modulus_bitlen, prng, prng_idx,
                                   out, &x)) != CRYPT_OK) {
       return err;
     }
   }
 
-  /* rsa exptmod the OAEP or PKCS #1 v1.5 pad */
+  /* rsa exptmod the OAEP or LTC_PKCS #1 v1.5 pad */
   return ltc_mp.rsa_me(out, x, out, outlen, PK_PUBLIC, key);
 }
 
-#endif /* MRSA */
+#endif /* LTC_MRSA */
 
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c,v $ */
-/* $Revision: 1.8 $ */
-/* $Date: 2006/11/01 09:18:22 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */