forked from wolfSSL/wolfssl
change sha512 hi/loLen to 64bits
This commit is contained in:
@ -499,7 +499,7 @@ static int _Transform(Sha512* sha512)
|
|||||||
|
|
||||||
static INLINE void AddLength(Sha512* sha512, word32 len)
|
static INLINE void AddLength(Sha512* sha512, word32 len)
|
||||||
{
|
{
|
||||||
word32 tmp = sha512->loLen;
|
word64 tmp = sha512->loLen;
|
||||||
if ( (sha512->loLen += len) < tmp)
|
if ( (sha512->loLen += len) < tmp)
|
||||||
sha512->hiLen++; /* carry low to high */
|
sha512->hiLen++; /* carry low to high */
|
||||||
}
|
}
|
||||||
@ -1418,7 +1418,7 @@ static int _Transform384(Sha384* sha384)
|
|||||||
|
|
||||||
static INLINE void AddLength384(Sha384* sha384, word32 len)
|
static INLINE void AddLength384(Sha384* sha384, word32 len)
|
||||||
{
|
{
|
||||||
word32 tmp = sha384->loLen;
|
word64 tmp = sha384->loLen;
|
||||||
if ( (sha384->loLen += len) < tmp)
|
if ( (sha384->loLen += len) < tmp)
|
||||||
sha384->hiLen++; /* carry low to high */
|
sha384->hiLen++; /* carry low to high */
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,8 @@ enum {
|
|||||||
/* Sha512 digest */
|
/* Sha512 digest */
|
||||||
typedef struct Sha512 {
|
typedef struct Sha512 {
|
||||||
word32 buffLen; /* in bytes */
|
word32 buffLen; /* in bytes */
|
||||||
word32 loLen; /* length in bytes */
|
word64 loLen; /* length in bytes */
|
||||||
word32 hiLen; /* length in bytes */
|
word64 hiLen; /* length in bytes */
|
||||||
word64 digest[SHA512_DIGEST_SIZE / sizeof(word64)];
|
word64 digest[SHA512_DIGEST_SIZE / sizeof(word64)];
|
||||||
word64 buffer[SHA512_BLOCK_SIZE / sizeof(word64)];
|
word64 buffer[SHA512_BLOCK_SIZE / sizeof(word64)];
|
||||||
} Sha512;
|
} Sha512;
|
||||||
@ -81,8 +81,8 @@ enum {
|
|||||||
/* Sha384 digest */
|
/* Sha384 digest */
|
||||||
typedef struct Sha384 {
|
typedef struct Sha384 {
|
||||||
word32 buffLen; /* in bytes */
|
word32 buffLen; /* in bytes */
|
||||||
word32 loLen; /* length in bytes */
|
word64 loLen; /* length in bytes */
|
||||||
word32 hiLen; /* length in bytes */
|
word64 hiLen; /* length in bytes */
|
||||||
word64 digest[SHA512_DIGEST_SIZE / sizeof(word64)]; /* for transform 512 */
|
word64 digest[SHA512_DIGEST_SIZE / sizeof(word64)]; /* for transform 512 */
|
||||||
word64 buffer[SHA384_BLOCK_SIZE / sizeof(word64)];
|
word64 buffer[SHA384_BLOCK_SIZE / sizeof(word64)];
|
||||||
} Sha384;
|
} Sha384;
|
||||||
|
Reference in New Issue
Block a user