2022-06-09 Niels Möller <nisse@lysator.liu.se>
- From Corentin Labbe:
+ Based on patches from Corentin Labbe:
* sha2.h: Declare new functions.
* sha256.c (sha256_compress): New function.
+ (COMPRESS): Updated to use sha256_compress.
+ (sha256_write_digest): Use sha256_compress directly.
* sha512.c (sha512_compress): New function.
+ (COMPRESS): Updated to use sha512_compress.
+ (sha512_write_digest): Use sha512_compress directly.
2022-06-02 Niels Möller <nisse@lysator.liu.se>
0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL,
};
-#define COMPRESS(ctx, data) (_nettle_sha256_compress((ctx)->state, (data), K))
+#define COMPRESS(ctx, data) (sha256_compress((ctx)->state, (data)))
/* Initialize the SHA values */
big-endian format, and will be converted back by the compression
function. It's probably not worth the effort to fix this. */
WRITE_UINT64(ctx->block + (SHA256_BLOCK_SIZE - 8), bit_count);
- COMPRESS(ctx, ctx->block);
+ sha256_compress(ctx->state, ctx->block);
_nettle_write_be32(length, digest, ctx->state);
}
0x5FCB6FAB3AD6FAECULL,0x6C44198C4A475817ULL,
};
-#define COMPRESS(ctx, data) (_nettle_sha512_compress((ctx)->state, (data), K))
+#define COMPRESS(ctx, data) (sha512_compress((ctx)->state, (data)))
void
sha512_init(struct sha512_ctx *ctx)
function. It's probably not worth the effort to fix this. */
WRITE_UINT64(ctx->block + (SHA512_BLOCK_SIZE - 16), high);
WRITE_UINT64(ctx->block + (SHA512_BLOCK_SIZE - 8), low);
- COMPRESS(ctx, ctx->block);
+ sha512_compress(ctx->state, ctx->block);
words = length / 8;
leftover = length % 8;