"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libjte/sha512.c" between
xorriso-1.5.2.tar.gz and xorriso-1.5.4.tar.gz

About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.

sha512.c  (xorriso-1.5.2):sha512.c  (xorriso-1.5.4)
skipping to change at line 269 skipping to change at line 269
ctx->H[3] = d; ctx->H[3] = d;
ctx->H[4] = e; ctx->H[4] = e;
ctx->H[5] = f; ctx->H[5] = f;
ctx->H[6] = g; ctx->H[6] = g;
ctx->H[7] = h; ctx->H[7] = h;
} }
/* Initialize structure containing state of computation. /* Initialize structure containing state of computation.
(FIPS 180-2:5.3.3) */ (FIPS 180-2:5.3.3) */
void void
sha512_init_ctx (ctx) sha512_init_ctx (struct sha512_ctx *ctx)
struct sha512_ctx *ctx;
{ {
#ifdef LIBJTE_INITIALIZE_32 #ifdef LIBJTE_INITIALIZE_32
if (!K_initialized) { if (!K_initialized) {
int i; int i;
for (i = 0; i < 80; i++) for (i = 0; i < 80; i++)
K[i] = (((uint64_t) K32[2 * i]) << 32) | K32[2 * i + 1]; K[i] = (((uint64_t) K32[2 * i]) << 32) | K32[2 * i + 1];
K_initialized = 1; K_initialized = 1;
skipping to change at line 315 skipping to change at line 314
ctx->total[0] = ctx->total[1] = 0; ctx->total[0] = ctx->total[1] = 0;
ctx->buflen = 0; ctx->buflen = 0;
} }
/* Process the remaining bytes in the internal buffer and the usual /* Process the remaining bytes in the internal buffer and the usual
prolog according to the standard and write the result to RESBUF. prolog according to the standard and write the result to RESBUF.
IMPORTANT: On some systems it is required that RESBUF is correctly IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */ aligned for a 32 bits value. */
void * void *
sha512_finish_ctx (ctx, resbuf) sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
struct sha512_ctx *ctx;
void *resbuf;
{ {
/* Take yet unprocessed bytes into account. */ /* Take yet unprocessed bytes into account. */
uint64_t bytes = ctx->buflen; uint64_t bytes = ctx->buflen;
size_t pad; size_t pad;
unsigned int i; unsigned int i;
/* Now count remaining bytes. */ /* Now count remaining bytes. */
ctx->total[0] += bytes; ctx->total[0] += bytes;
if (ctx->total[0] < bytes) if (ctx->total[0] < bytes)
++ctx->total[1]; ++ctx->total[1];
skipping to change at line 348 skipping to change at line 345
sha512_process_block (ctx->buffer, bytes + pad + 16, ctx); sha512_process_block (ctx->buffer, bytes + pad + 16, ctx);
/* Put result from CTX in first 64 bytes following RESBUF. */ /* Put result from CTX in first 64 bytes following RESBUF. */
for (i = 0; i < 8; ++i) for (i = 0; i < 8; ++i)
((uint64_t *) resbuf)[i] = SWAP (ctx->H[i]); ((uint64_t *) resbuf)[i] = SWAP (ctx->H[i]);
return resbuf; return resbuf;
} }
void void
sha512_process_bytes (buffer, len, ctx) sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
const void *buffer;
size_t len;
struct sha512_ctx *ctx;
{ {
/* When we already have some bits in our internal buffer concatenate /* When we already have some bits in our internal buffer concatenate
both inputs first. */ both inputs first. */
if (ctx->buflen != 0) if (ctx->buflen != 0)
{ {
size_t left_over = ctx->buflen; size_t left_over = ctx->buflen;
size_t add = 256 - left_over > len ? len : 256 - left_over; size_t add = 256 - left_over > len ? len : 256 - left_over;
memcpy (&ctx->buffer[left_over], buffer, add); memcpy (&ctx->buffer[left_over], buffer, add);
ctx->buflen += add; ctx->buflen += add;
 End of changes. 3 change blocks. 
9 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)