Mercurial > dropbear
diff libtomcrypt/src/pk/rsa/rsa_sign_hash.c @ 1437:871b18fd7065 fuzz
merge from main (libtommath/libtomcrypt/curve25510-donna updates)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 24 Jun 2017 22:51:45 +0800 |
parents | f849a5ca2efc |
children | 6dba84798cd5 |
line wrap: on
line diff
--- a/libtomcrypt/src/pk/rsa/rsa_sign_hash.c Sat Jun 24 10:34:58 2017 +0800 +++ b/libtomcrypt/src/pk/rsa/rsa_sign_hash.c Sat Jun 24 22:51:45 2017 +0800 @@ -6,24 +6,24 @@ * 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_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 @@ 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 @@ 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 @@ 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 @@ } 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 @@ 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$ */