add SHA512 signature creation

This commit is contained in:
toddouska
2015-08-31 13:51:52 -07:00
parent 756cff4cb4
commit 1368ae1fb1

View File

@@ -5985,7 +5985,7 @@ static int MakeSignature(const byte* buffer, int sz, byte* sig, int sigSz,
int sigAlgoType)
{
int encSigSz, digestSz, typeH = 0, ret = 0;
byte digest[SHA256_DIGEST_SIZE]; /* max size */
byte digest[MAX_DIGEST_SIZE]; /* max size */
#ifdef WOLFSSL_SMALL_STACK
byte* encSig;
#else
@@ -6032,6 +6032,15 @@ static int MakeSignature(const byte* buffer, int sz, byte* sig, int sigSz,
digestSz = SHA256_DIGEST_SIZE;
}
break;
#endif
#ifdef WOLFSSL_SHA512
case CTC_SHA512wRSA:
case CTC_SHA512wECDSA:
if ((ret = wc_Sha512Hash(buffer, sz, digest)) == 0) {
typeH = SHA256h;
digestSz = SHA256_DIGEST_SIZE;
}
break;
#endif
default:
WOLFSSL_MSG("MakeSignautre called with unsupported type");