mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
add SHA512 signature creation
This commit is contained in:
@@ -5985,7 +5985,7 @@ static int MakeSignature(const byte* buffer, int sz, byte* sig, int sigSz,
|
|||||||
int sigAlgoType)
|
int sigAlgoType)
|
||||||
{
|
{
|
||||||
int encSigSz, digestSz, typeH = 0, ret = 0;
|
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
|
#ifdef WOLFSSL_SMALL_STACK
|
||||||
byte* encSig;
|
byte* encSig;
|
||||||
#else
|
#else
|
||||||
@@ -6032,6 +6032,15 @@ static int MakeSignature(const byte* buffer, int sz, byte* sig, int sigSz,
|
|||||||
digestSz = SHA256_DIGEST_SIZE;
|
digestSz = SHA256_DIGEST_SIZE;
|
||||||
}
|
}
|
||||||
break;
|
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
|
#endif
|
||||||
default:
|
default:
|
||||||
WOLFSSL_MSG("MakeSignautre called with unsupported type");
|
WOLFSSL_MSG("MakeSignautre called with unsupported type");
|
||||||
|
Reference in New Issue
Block a user