summaryrefslogtreecommitdiffhomepage
path: root/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c')
-rw-r--r--libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c b/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c
index 4403477..5042946 100644
--- a/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c
+++ b/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_encode.c
@@ -5,20 +5,18 @@
*
* The library is free for all purposes without any express
* guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file pkcs_1_oaep_encode.c
- OAEP Padding for LTC_PKCS #1, Tom St Denis
+ OAEP Padding for PKCS #1, Tom St Denis
*/
#ifdef LTC_PKCS_1
/**
- LTC_PKCS #1 v2.00 OAEP encode
+ PKCS #1 v2.00 OAEP encode
@param msg The data to encode
@param msglen The length of the data to encode (octets)
@param lparam A session or system parameter (can be NULL)
@@ -46,7 +44,7 @@ int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen,
LTC_ARGCHK(outlen != NULL);
/* test valid hash */
- if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) {
+ if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) {
return err;
}
@@ -120,10 +118,10 @@ int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen,
/* xor against DB */
for (y = 0; y < (modulus_len - hLen - 1); y++) {
- DB[y] ^= mask[y];
+ DB[y] ^= mask[y];
}
- /* compute MGF1 of maskedDB (hLen) */
+ /* compute MGF1 of maskedDB (hLen) */
if ((err = pkcs_1_mgf1(hash_idx, DB, modulus_len - hLen - 1, mask, hLen)) != CRYPT_OK) {
goto LBL_ERR;
}
@@ -149,7 +147,7 @@ int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen,
x += modulus_len - hLen - 1;
*outlen = x;
-
+
err = CRYPT_OK;
LBL_ERR:
#ifdef LTC_CLEAN_STACK
@@ -168,6 +166,6 @@ LBL_ERR:
#endif /* LTC_PKCS_1 */
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref: $Format:%D$ */
+/* git commit: $Format:%H$ */
+/* commit time: $Format:%ai$ */