comparison src/pk/pkcs1/pkcs_1_pss_decode.c @ 209:39d5d58461d6 libtomcrypt-orig LTC_1.05

Import of libtomcrypt 1.05
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 Jul 2005 03:53:40 +0000
parents 1c15b283127b
children
comparison
equal deleted inserted replaced
191:1c15b283127b 209:39d5d58461d6
85 err = CRYPT_OK; 85 err = CRYPT_OK;
86 goto LBL_ERR; 86 goto LBL_ERR;
87 } 87 }
88 88
89 /* copy out the DB */ 89 /* copy out the DB */
90 for (x = 0; x < modulus_len - hLen - 1; x++) { 90 x = 0;
91 DB[x] = sig[x]; 91 XMEMCPY(DB, sig + x, modulus_len - hLen - 1);
92 } 92 x += modulus_len - hLen - 1;
93 93
94 /* copy out the hash */ 94 /* copy out the hash */
95 for (y = 0; y < hLen; y++) { 95 XMEMCPY(hash, sig + x, hLen);
96 hash[y] = sig[x++]; 96 x += hLen;
97 }
98 97
99 /* check the MSB */ 98 /* check the MSB */
100 if ((sig[0] & ~(0xFF >> ((modulus_len<<3) - (modulus_bitlen-1)))) != 0) { 99 if ((sig[0] & ~(0xFF >> ((modulus_len<<3) - (modulus_bitlen-1)))) != 0) {
101 err = CRYPT_OK; 100 err = CRYPT_OK;
102 goto LBL_ERR; 101 goto LBL_ERR;
170 169
171 return err; 170 return err;
172 } 171 }
173 172
174 #endif /* PKCS_1 */ 173 #endif /* PKCS_1 */
174
175 /* $Source: /cvs/libtom/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c,v $ */
176 /* $Revision: 1.4 $ */
177 /* $Date: 2005/05/05 14:35:59 $ */