summaryrefslogtreecommitdiffhomepage
path: root/libtomcrypt/src/pk/rsa
diff options
context:
space:
mode:
Diffstat (limited to 'libtomcrypt/src/pk/rsa')
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_decrypt_key.c30
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_encrypt_key.c32
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_export.c16
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_exptmod.c12
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_free.c10
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_import.c18
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_make_key.c10
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_sign_hash.c28
-rw-r--r--libtomcrypt/src/pk/rsa/rsa_verify_hash.c30
9 files changed, 93 insertions, 93 deletions
diff --git a/libtomcrypt/src/pk/rsa/rsa_decrypt_key.c b/libtomcrypt/src/pk/rsa/rsa_decrypt_key.c
index 3dce20f..31d841f 100644
--- a/libtomcrypt/src/pk/rsa/rsa_decrypt_key.c
+++ b/libtomcrypt/src/pk/rsa/rsa_decrypt_key.c
@@ -6,19 +6,19 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file rsa_decrypt_key.c
- RSA PKCS #1 Decryption, Tom St Denis and Andreas Lange
+ RSA LTC_PKCS #1 Decryption, Tom St Denis and Andreas Lange
*/
-#ifdef MRSA
+#ifdef LTC_MRSA
/**
- PKCS #1 decrypt then v1.5 or OAEP depad
+ LTC_PKCS #1 decrypt then v1.5 or OAEP depad
@param in The ciphertext
@param inlen The length of the ciphertext (octets)
@param out [out] The plaintext
@@ -26,7 +26,7 @@
@param lparam The system "lparam" value
@param lparamlen The length of the lparam value (octets)
@param hash_idx The index of the hash desired
- @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 stat [out] Result of the decryption, 1==valid, 0==invalid
@param key The corresponding private RSA key
@return CRYPT_OK if succcessul (even if invalid)
@@ -51,12 +51,12 @@ int rsa_decrypt_key_ex(const unsigned char *in, unsigned long inlen,
/* 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;
}
- 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;
@@ -85,21 +85,21 @@ int rsa_decrypt_key_ex(const unsigned char *in, unsigned long inlen,
return err;
}
- if (padding == LTC_PKCS_1_OAEP) {
+ if (padding == LTC_LTC_PKCS_1_OAEP) {
/* now OAEP decode the packet */
err = pkcs_1_oaep_decode(tmp, x, lparam, lparamlen, modulus_bitlen, hash_idx,
out, outlen, stat);
} else {
- /* now PKCS #1 v1.5 depad the packet */
- err = pkcs_1_v1_5_decode(tmp, x, LTC_PKCS_1_EME, modulus_bitlen, out, outlen, stat);
+ /* now LTC_PKCS #1 v1.5 depad the packet */
+ err = pkcs_1_v1_5_decode(tmp, x, LTC_LTC_PKCS_1_EME, modulus_bitlen, out, outlen, stat);
}
XFREE(tmp);
return err;
}
-#endif /* MRSA */
+#endif /* LTC_MRSA */
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_decrypt_key.c,v $ */
-/* $Revision: 1.8 $ */
-/* $Date: 2006/11/01 09:18:22 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c b/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c
index 8d2c228..edb7e65 100644
--- a/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c
+++ b/libtomcrypt/src/pk/rsa/rsa_encrypt_key.c
@@ -6,19 +6,19 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, 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 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen,
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 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen,
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 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen,
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 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen,
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$ */
diff --git a/libtomcrypt/src/pk/rsa/rsa_export.c b/libtomcrypt/src/pk/rsa/rsa_export.c
index 5b389ec..40cb066 100644
--- a/libtomcrypt/src/pk/rsa/rsa_export.c
+++ b/libtomcrypt/src/pk/rsa/rsa_export.c
@@ -6,19 +6,19 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file rsa_export.c
- Export RSA PKCS keys, Tom St Denis
+ Export RSA LTC_PKCS keys, Tom St Denis
*/
-#ifdef MRSA
+#ifdef LTC_MRSA
/**
- This will export either an RSAPublicKey or RSAPrivateKey [defined in PKCS #1 v2.1]
+ This will export either an RSAPublicKey or RSAPrivateKey [defined in LTC_PKCS #1 v2.1]
@param out [out] Destination of the packet
@param outlen [in/out] The max size and resulting size of the packet
@param type The type of exported key (PK_PRIVATE or PK_PUBLIC)
@@ -62,8 +62,8 @@ int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key
}
}
-#endif /* MRSA */
+#endif /* LTC_MRSA */
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_export.c,v $ */
-/* $Revision: 1.15 $ */
-/* $Date: 2006/03/31 14:15:35 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/pk/rsa/rsa_exptmod.c b/libtomcrypt/src/pk/rsa/rsa_exptmod.c
index 53dbf6b..101a766 100644
--- a/libtomcrypt/src/pk/rsa/rsa_exptmod.c
+++ b/libtomcrypt/src/pk/rsa/rsa_exptmod.c
@@ -6,16 +6,16 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file rsa_exptmod.c
- RSA PKCS exptmod, Tom St Denis
+ RSA LTC_PKCS exptmod, Tom St Denis
*/
-#ifdef MRSA
+#ifdef LTC_MRSA
/**
Compute an RSA modular exponentiation
@@ -108,6 +108,6 @@ error:
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_exptmod.c,v $ */
-/* $Revision: 1.16 $ */
-/* $Date: 2006/12/04 03:09:28 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/pk/rsa/rsa_free.c b/libtomcrypt/src/pk/rsa/rsa_free.c
index f48976a..bb6daef 100644
--- a/libtomcrypt/src/pk/rsa/rsa_free.c
+++ b/libtomcrypt/src/pk/rsa/rsa_free.c
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
@@ -15,7 +15,7 @@
Free an RSA key, Tom St Denis
*/
-#ifdef MRSA
+#ifdef LTC_MRSA
/**
Free an RSA key from memory
@@ -29,6 +29,6 @@ void rsa_free(rsa_key *key)
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_free.c,v $ */
-/* $Revision: 1.8 $ */
-/* $Date: 2006/12/04 22:23:27 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/pk/rsa/rsa_import.c b/libtomcrypt/src/pk/rsa/rsa_import.c
index 7b12fd9..85c676b 100644
--- a/libtomcrypt/src/pk/rsa/rsa_import.c
+++ b/libtomcrypt/src/pk/rsa/rsa_import.c
@@ -6,19 +6,19 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file rsa_import.c
- Import a PKCS RSA key, Tom St Denis
+ Import a LTC_PKCS RSA key, Tom St Denis
*/
-#ifdef MRSA
+#ifdef LTC_MRSA
/**
- Import an RSAPublicKey or RSAPrivateKey [two-prime only, only support >= 1024-bit keys, defined in PKCS #1 v2.1]
+ Import an RSAPublicKey or RSAPrivateKey [two-prime only, only support >= 1024-bit keys, defined in LTC_PKCS #1 v2.1]
@param in The packet to import from
@param inlen It's length (octets)
@param key [out] Destination for newly imported key
@@ -87,7 +87,7 @@ int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key)
}
XFREE(tmpbuf);
- /* not SSL public key, try to match against PKCS #1 standards */
+ /* not SSL public key, try to match against LTC_PKCS #1 standards */
if ((err = der_decode_sequence_multi(in, inlen,
LTC_ASN1_INTEGER, 1UL, key->N,
LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) {
@@ -135,9 +135,9 @@ LBL_ERR:
return err;
}
-#endif /* MRSA */
+#endif /* LTC_MRSA */
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_import.c,v $ */
-/* $Revision: 1.21 $ */
-/* $Date: 2006/12/04 22:23:27 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/pk/rsa/rsa_make_key.c b/libtomcrypt/src/pk/rsa/rsa_make_key.c
index bd2a29b..d62e37e 100644
--- a/libtomcrypt/src/pk/rsa/rsa_make_key.c
+++ b/libtomcrypt/src/pk/rsa/rsa_make_key.c
@@ -6,7 +6,7 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
@@ -15,7 +15,7 @@
RSA key generation, Tom St Denis
*/
-#ifdef MRSA
+#ifdef LTC_MRSA
/**
Create an RSA key
@@ -107,6 +107,6 @@ cleanup:
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_make_key.c,v $ */
-/* $Revision: 1.14 $ */
-/* $Date: 2006/12/04 22:23:27 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/pk/rsa/rsa_sign_hash.c b/libtomcrypt/src/pk/rsa/rsa_sign_hash.c
index f10a97a..3b64095 100644
--- a/libtomcrypt/src/pk/rsa/rsa_sign_hash.c
+++ b/libtomcrypt/src/pk/rsa/rsa_sign_hash.c
@@ -6,24 +6,24 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file rsa_sign_hash.c
- RSA PKCS #1 v1.5 and v2 PSS sign hash, Tom St Denis and Andreas Lange
+ RSA LTC_PKCS #1 v1.5 and v2 PSS sign hash, Tom St Denis and Andreas Lange
*/
-#ifdef MRSA
+#ifdef LTC_MRSA
/**
- PKCS #1 pad then sign
+ LTC_PKCS #1 pad then sign
@param in The hash to sign
@param inlen The length of the hash to sign (octets)
@param out [out] The signature
@param outlen [in/out] The max size and resulting size of the signature
- @param padding Type of padding (LTC_PKCS_1_PSS or LTC_PKCS_1_V1_5)
+ @param padding Type of padding (LTC_LTC_PKCS_1_PSS or LTC_LTC_PKCS_1_V1_5)
@param prng An active PRNG state
@param prng_idx The index of the PRNG desired
@param hash_idx The index of the hash desired
@@ -47,11 +47,11 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen,
LTC_ARGCHK(key != NULL);
/* valid padding? */
- if ((padding != LTC_PKCS_1_V1_5) && (padding != LTC_PKCS_1_PSS)) {
+ if ((padding != LTC_LTC_PKCS_1_V1_5) && (padding != LTC_LTC_PKCS_1_PSS)) {
return CRYPT_PK_INVALID_PADDING;
}
- if (padding == LTC_PKCS_1_PSS) {
+ if (padding == LTC_LTC_PKCS_1_PSS) {
/* valid prng and hash ? */
if ((err = prng_is_valid(prng_idx)) != CRYPT_OK) {
return err;
@@ -71,7 +71,7 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen,
return CRYPT_BUFFER_OVERFLOW;
}
- if (padding == LTC_PKCS_1_PSS) {
+ if (padding == LTC_LTC_PKCS_1_PSS) {
/* PSS pad the key */
x = *outlen;
if ((err = pkcs_1_pss_encode(in, inlen, saltlen, prng, prng_idx,
@@ -79,7 +79,7 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen,
return err;
}
} else {
- /* PKCS #1 v1.5 pad the hash */
+ /* LTC_PKCS #1 v1.5 pad the hash */
unsigned char *tmpin;
ltc_asn1_list digestinfo[2], siginfo[2];
@@ -114,7 +114,7 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen,
}
x = *outlen;
- if ((err = pkcs_1_v1_5_encode(tmpin, y, LTC_PKCS_1_EMSA,
+ if ((err = pkcs_1_v1_5_encode(tmpin, y, LTC_LTC_PKCS_1_EMSA,
modulus_bitlen, NULL, 0,
out, &x)) != CRYPT_OK) {
XFREE(tmpin);
@@ -127,8 +127,8 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen,
return ltc_mp.rsa_me(out, x, out, outlen, PK_PRIVATE, key);
}
-#endif /* MRSA */
+#endif /* LTC_MRSA */
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_sign_hash.c,v $ */
-/* $Revision: 1.9 $ */
-/* $Date: 2006/11/09 23:15:39 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/pk/rsa/rsa_verify_hash.c b/libtomcrypt/src/pk/rsa/rsa_verify_hash.c
index 4b61029..fe83690 100644
--- a/libtomcrypt/src/pk/rsa/rsa_verify_hash.c
+++ b/libtomcrypt/src/pk/rsa/rsa_verify_hash.c
@@ -6,24 +6,24 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file rsa_verify_hash.c
- RSA PKCS #1 v1.5 or v2 PSS signature verification, Tom St Denis and Andreas Lange
+ RSA LTC_PKCS #1 v1.5 or v2 PSS signature verification, Tom St Denis and Andreas Lange
*/
-#ifdef MRSA
+#ifdef LTC_MRSA
/**
- PKCS #1 de-sign then v1.5 or PSS depad
+ LTC_PKCS #1 de-sign then v1.5 or PSS depad
@param sig The signature data
@param siglen The length of the signature data (octets)
@param hash The hash of the message that was signed
@param hashlen The length of the hash of the message that was signed (octets)
- @param padding Type of padding (LTC_PKCS_1_PSS or LTC_PKCS_1_V1_5)
+ @param padding Type of padding (LTC_LTC_PKCS_1_PSS or LTC_LTC_PKCS_1_V1_5)
@param hash_idx The index of the desired hash
@param saltlen The length of the salt used during signature
@param stat [out] The result of the signature comparison, 1==valid, 0==invalid
@@ -50,12 +50,12 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen,
/* valid padding? */
- if ((padding != LTC_PKCS_1_V1_5) &&
- (padding != LTC_PKCS_1_PSS)) {
+ if ((padding != LTC_LTC_PKCS_1_V1_5) &&
+ (padding != LTC_LTC_PKCS_1_PSS)) {
return CRYPT_PK_INVALID_PADDING;
}
- if (padding == LTC_PKCS_1_PSS) {
+ if (padding == LTC_LTC_PKCS_1_PSS) {
/* valid hash ? */
if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) {
return err;
@@ -90,11 +90,11 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen,
return CRYPT_INVALID_PACKET;
}
- if (padding == LTC_PKCS_1_PSS) {
+ if (padding == LTC_LTC_PKCS_1_PSS) {
/* PSS decode and verify it */
err = pkcs_1_pss_decode(hash, hashlen, tmpbuf, x, saltlen, hash_idx, modulus_bitlen, stat);
} else {
- /* PKCS #1 v1.5 decode it */
+ /* LTC_PKCS #1 v1.5 decode it */
unsigned char *out;
unsigned long outlen, loid[16];
int decoded;
@@ -114,7 +114,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen,
goto bail_2;
}
- if ((err = pkcs_1_v1_5_decode(tmpbuf, x, LTC_PKCS_1_EMSA, modulus_bitlen, out, &outlen, &decoded)) != CRYPT_OK) {
+ if ((err = pkcs_1_v1_5_decode(tmpbuf, x, LTC_LTC_PKCS_1_EMSA, modulus_bitlen, out, &outlen, &decoded)) != CRYPT_OK) {
XFREE(out);
goto bail_2;
}
@@ -160,8 +160,8 @@ bail_2:
return err;
}
-#endif /* MRSA */
+#endif /* LTC_MRSA */
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_verify_hash.c,v $ */
-/* $Revision: 1.11 $ */
-/* $Date: 2006/12/04 03:09:28 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */