Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging/skein: variable/member name cleanup

Rename a few more variables and structure member names to lower case.

Signed-off-by: Jake Edge <jake@lwn.net>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jake Edge and committed by
Greg Kroah-Hartman
007dfe5a a82100e7

+185 -184
+74 -74
drivers/staging/skein/skein.c
··· 33 33 34 34 switch (hash_bit_len) { /* use pre-computed values, where available */ 35 35 case 256: 36 - memcpy(ctx->X, SKEIN_256_IV_256, sizeof(ctx->X)); 36 + memcpy(ctx->x, SKEIN_256_IV_256, sizeof(ctx->x)); 37 37 break; 38 38 case 224: 39 - memcpy(ctx->X, SKEIN_256_IV_224, sizeof(ctx->X)); 39 + memcpy(ctx->x, SKEIN_256_IV_224, sizeof(ctx->x)); 40 40 break; 41 41 case 160: 42 - memcpy(ctx->X, SKEIN_256_IV_160, sizeof(ctx->X)); 42 + memcpy(ctx->x, SKEIN_256_IV_160, sizeof(ctx->x)); 43 43 break; 44 44 case 128: 45 - memcpy(ctx->X, SKEIN_256_IV_128, sizeof(ctx->X)); 45 + memcpy(ctx->x, SKEIN_256_IV_128, sizeof(ctx->x)); 46 46 break; 47 47 default: 48 48 /* here if there is no precomputed IV value available */ ··· 63 63 64 64 /* compute the initial chaining values from config block */ 65 65 /* zero the chaining variables */ 66 - memset(ctx->X, 0, sizeof(ctx->X)); 66 + memset(ctx->x, 0, sizeof(ctx->x)); 67 67 skein_256_process_block(ctx, cfg.b, 1, SKEIN_CFG_STR_LEN); 68 68 break; 69 69 } 70 - /* The chaining vars ctx->X are now initialized for hash_bit_len. */ 70 + /* The chaining vars ctx->x are now initialized for hash_bit_len. */ 71 71 /* Set up to process the data message portion of the hash (default) */ 72 72 skein_start_new_type(ctx, MSG); /* T0=0, T1= MSG type */ 73 73 ··· 89 89 skein_assert_ret(hash_bit_len > 0, SKEIN_BAD_HASHLEN); 90 90 skein_assert_ret(key_bytes == 0 || key != NULL, SKEIN_FAIL); 91 91 92 - /* compute the initial chaining values ctx->X[], based on key */ 92 + /* compute the initial chaining values ctx->x[], based on key */ 93 93 if (key_bytes == 0) { /* is there a key? */ 94 94 /* no key: use all zeroes as key for config block */ 95 - memset(ctx->X, 0, sizeof(ctx->X)); 95 + memset(ctx->x, 0, sizeof(ctx->x)); 96 96 } else { /* here to pre-process a key */ 97 - skein_assert(sizeof(cfg.b) >= sizeof(ctx->X)); 97 + skein_assert(sizeof(cfg.b) >= sizeof(ctx->x)); 98 98 /* do a mini-Init right here */ 99 99 /* set output hash bit count = state size */ 100 - ctx->h.hash_bit_len = 8*sizeof(ctx->X); 100 + ctx->h.hash_bit_len = 8*sizeof(ctx->x); 101 101 /* set tweaks: T0 = 0; T1 = KEY type */ 102 102 skein_start_new_type(ctx, KEY); 103 103 /* zero the initial chaining variables */ 104 - memset(ctx->X, 0, sizeof(ctx->X)); 104 + memset(ctx->x, 0, sizeof(ctx->x)); 105 105 /* hash the key */ 106 106 skein_256_update(ctx, key, key_bytes); 107 107 /* put result into cfg.b[] */ 108 108 skein_256_final_pad(ctx, cfg.b); 109 - /* copy over into ctx->X[] */ 110 - memcpy(ctx->X, cfg.b, sizeof(cfg.b)); 109 + /* copy over into ctx->x[] */ 110 + memcpy(ctx->x, cfg.b, sizeof(cfg.b)); 111 111 } 112 112 /* 113 113 * build/process the config block, type == CONFIG (could be ··· 130 130 /* compute the initial chaining values from config block */ 131 131 skein_256_process_block(ctx, cfg.b, 1, SKEIN_CFG_STR_LEN); 132 132 133 - /* The chaining vars ctx->X are now initialized */ 133 + /* The chaining vars ctx->x are now initialized */ 134 134 /* Set up to process the data message portion of the hash (default) */ 135 135 skein_start_new_type(ctx, MSG); 136 136 ··· 197 197 int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val) 198 198 { 199 199 size_t i, n, byte_cnt; 200 - u64 X[SKEIN_256_STATE_WORDS]; 200 + u64 x[SKEIN_256_STATE_WORDS]; 201 201 /* catch uninitialized context */ 202 202 skein_assert_ret(ctx->h.b_cnt <= SKEIN_256_BLOCK_BYTES, SKEIN_FAIL); 203 203 204 204 /* tag as the final block */ 205 - ctx->h.T[1] |= SKEIN_T1_FLAG_FINAL; 205 + ctx->h.tweak[1] |= SKEIN_T1_FLAG_FINAL; 206 206 /* zero pad b[] if necessary */ 207 207 if (ctx->h.b_cnt < SKEIN_256_BLOCK_BYTES) 208 208 memset(&ctx->b[ctx->h.b_cnt], 0, ··· 219 219 /* zero out b[], so it can hold the counter */ 220 220 memset(ctx->b, 0, sizeof(ctx->b)); 221 221 /* keep a local copy of counter mode "key" */ 222 - memcpy(X, ctx->X, sizeof(X)); 222 + memcpy(x, ctx->x, sizeof(x)); 223 223 for (i = 0; i*SKEIN_256_BLOCK_BYTES < byte_cnt; i++) { 224 224 /* build the counter block */ 225 225 ((u64 *)ctx->b)[0] = skein_swap64((u64) i); ··· 231 231 if (n >= SKEIN_256_BLOCK_BYTES) 232 232 n = SKEIN_256_BLOCK_BYTES; 233 233 /* "output" the ctr mode bytes */ 234 - skein_put64_lsb_first(hash_val+i*SKEIN_256_BLOCK_BYTES, ctx->X, 234 + skein_put64_lsb_first(hash_val+i*SKEIN_256_BLOCK_BYTES, ctx->x, 235 235 n); 236 236 skein_show_final(256, &ctx->h, n, 237 237 hash_val+i*SKEIN_256_BLOCK_BYTES); 238 238 /* restore the counter mode key for next time */ 239 - memcpy(ctx->X, X, sizeof(X)); 239 + memcpy(ctx->x, x, sizeof(x)); 240 240 } 241 241 return SKEIN_SUCCESS; 242 242 } ··· 259 259 260 260 switch (hash_bit_len) { /* use pre-computed values, where available */ 261 261 case 512: 262 - memcpy(ctx->X, SKEIN_512_IV_512, sizeof(ctx->X)); 262 + memcpy(ctx->x, SKEIN_512_IV_512, sizeof(ctx->x)); 263 263 break; 264 264 case 384: 265 - memcpy(ctx->X, SKEIN_512_IV_384, sizeof(ctx->X)); 265 + memcpy(ctx->x, SKEIN_512_IV_384, sizeof(ctx->x)); 266 266 break; 267 267 case 256: 268 - memcpy(ctx->X, SKEIN_512_IV_256, sizeof(ctx->X)); 268 + memcpy(ctx->x, SKEIN_512_IV_256, sizeof(ctx->x)); 269 269 break; 270 270 case 224: 271 - memcpy(ctx->X, SKEIN_512_IV_224, sizeof(ctx->X)); 271 + memcpy(ctx->x, SKEIN_512_IV_224, sizeof(ctx->x)); 272 272 break; 273 273 default: 274 274 /* here if there is no precomputed IV value available */ ··· 289 289 290 290 /* compute the initial chaining values from config block */ 291 291 /* zero the chaining variables */ 292 - memset(ctx->X, 0, sizeof(ctx->X)); 292 + memset(ctx->x, 0, sizeof(ctx->x)); 293 293 skein_512_process_block(ctx, cfg.b, 1, SKEIN_CFG_STR_LEN); 294 294 break; 295 295 } 296 296 297 297 /* 298 - * The chaining vars ctx->X are now initialized for the given 298 + * The chaining vars ctx->x are now initialized for the given 299 299 * hash_bit_len. 300 300 */ 301 301 /* Set up to process the data message portion of the hash (default) */ ··· 319 319 skein_assert_ret(hash_bit_len > 0, SKEIN_BAD_HASHLEN); 320 320 skein_assert_ret(key_bytes == 0 || key != NULL, SKEIN_FAIL); 321 321 322 - /* compute the initial chaining values ctx->X[], based on key */ 322 + /* compute the initial chaining values ctx->x[], based on key */ 323 323 if (key_bytes == 0) { /* is there a key? */ 324 324 /* no key: use all zeroes as key for config block */ 325 - memset(ctx->X, 0, sizeof(ctx->X)); 325 + memset(ctx->x, 0, sizeof(ctx->x)); 326 326 } else { /* here to pre-process a key */ 327 - skein_assert(sizeof(cfg.b) >= sizeof(ctx->X)); 327 + skein_assert(sizeof(cfg.b) >= sizeof(ctx->x)); 328 328 /* do a mini-Init right here */ 329 329 /* set output hash bit count = state size */ 330 - ctx->h.hash_bit_len = 8*sizeof(ctx->X); 330 + ctx->h.hash_bit_len = 8*sizeof(ctx->x); 331 331 /* set tweaks: T0 = 0; T1 = KEY type */ 332 332 skein_start_new_type(ctx, KEY); 333 333 /* zero the initial chaining variables */ 334 - memset(ctx->X, 0, sizeof(ctx->X)); 334 + memset(ctx->x, 0, sizeof(ctx->x)); 335 335 /* hash the key */ 336 336 skein_512_update(ctx, key, key_bytes); 337 337 /* put result into cfg.b[] */ 338 338 skein_512_final_pad(ctx, cfg.b); 339 - /* copy over into ctx->X[] */ 340 - memcpy(ctx->X, cfg.b, sizeof(cfg.b)); 339 + /* copy over into ctx->x[] */ 340 + memcpy(ctx->x, cfg.b, sizeof(cfg.b)); 341 341 } 342 342 /* 343 343 * build/process the config block, type == CONFIG (could be ··· 359 359 /* compute the initial chaining values from config block */ 360 360 skein_512_process_block(ctx, cfg.b, 1, SKEIN_CFG_STR_LEN); 361 361 362 - /* The chaining vars ctx->X are now initialized */ 362 + /* The chaining vars ctx->x are now initialized */ 363 363 /* Set up to process the data message portion of the hash (default) */ 364 364 skein_start_new_type(ctx, MSG); 365 365 ··· 426 426 int skein_512_final(struct skein_512_ctx *ctx, u8 *hash_val) 427 427 { 428 428 size_t i, n, byte_cnt; 429 - u64 X[SKEIN_512_STATE_WORDS]; 429 + u64 x[SKEIN_512_STATE_WORDS]; 430 430 /* catch uninitialized context */ 431 431 skein_assert_ret(ctx->h.b_cnt <= SKEIN_512_BLOCK_BYTES, SKEIN_FAIL); 432 432 433 433 /* tag as the final block */ 434 - ctx->h.T[1] |= SKEIN_T1_FLAG_FINAL; 434 + ctx->h.tweak[1] |= SKEIN_T1_FLAG_FINAL; 435 435 /* zero pad b[] if necessary */ 436 436 if (ctx->h.b_cnt < SKEIN_512_BLOCK_BYTES) 437 437 memset(&ctx->b[ctx->h.b_cnt], 0, ··· 448 448 /* zero out b[], so it can hold the counter */ 449 449 memset(ctx->b, 0, sizeof(ctx->b)); 450 450 /* keep a local copy of counter mode "key" */ 451 - memcpy(X, ctx->X, sizeof(X)); 451 + memcpy(x, ctx->x, sizeof(x)); 452 452 for (i = 0; i*SKEIN_512_BLOCK_BYTES < byte_cnt; i++) { 453 453 /* build the counter block */ 454 454 ((u64 *)ctx->b)[0] = skein_swap64((u64) i); ··· 460 460 if (n >= SKEIN_512_BLOCK_BYTES) 461 461 n = SKEIN_512_BLOCK_BYTES; 462 462 /* "output" the ctr mode bytes */ 463 - skein_put64_lsb_first(hash_val+i*SKEIN_512_BLOCK_BYTES, ctx->X, 463 + skein_put64_lsb_first(hash_val+i*SKEIN_512_BLOCK_BYTES, ctx->x, 464 464 n); 465 465 skein_show_final(512, &ctx->h, n, 466 466 hash_val+i*SKEIN_512_BLOCK_BYTES); 467 467 /* restore the counter mode key for next time */ 468 - memcpy(ctx->X, X, sizeof(X)); 468 + memcpy(ctx->x, x, sizeof(x)); 469 469 } 470 470 return SKEIN_SUCCESS; 471 471 } ··· 488 488 489 489 switch (hash_bit_len) { /* use pre-computed values, where available */ 490 490 case 512: 491 - memcpy(ctx->X, SKEIN_1024_IV_512, sizeof(ctx->X)); 491 + memcpy(ctx->x, SKEIN_1024_IV_512, sizeof(ctx->x)); 492 492 break; 493 493 case 384: 494 - memcpy(ctx->X, SKEIN_1024_IV_384, sizeof(ctx->X)); 494 + memcpy(ctx->x, SKEIN_1024_IV_384, sizeof(ctx->x)); 495 495 break; 496 496 case 1024: 497 - memcpy(ctx->X, SKEIN_1024_IV_1024, sizeof(ctx->X)); 497 + memcpy(ctx->x, SKEIN_1024_IV_1024, sizeof(ctx->x)); 498 498 break; 499 499 default: 500 500 /* here if there is no precomputed IV value available */ ··· 515 515 516 516 /* compute the initial chaining values from config block */ 517 517 /* zero the chaining variables */ 518 - memset(ctx->X, 0, sizeof(ctx->X)); 518 + memset(ctx->x, 0, sizeof(ctx->x)); 519 519 skein_1024_process_block(ctx, cfg.b, 1, SKEIN_CFG_STR_LEN); 520 520 break; 521 521 } 522 522 523 - /* The chaining vars ctx->X are now initialized for the hash_bit_len. */ 523 + /* The chaining vars ctx->x are now initialized for the hash_bit_len. */ 524 524 /* Set up to process the data message portion of the hash (default) */ 525 525 skein_start_new_type(ctx, MSG); /* T0=0, T1= MSG type */ 526 526 ··· 542 542 skein_assert_ret(hash_bit_len > 0, SKEIN_BAD_HASHLEN); 543 543 skein_assert_ret(key_bytes == 0 || key != NULL, SKEIN_FAIL); 544 544 545 - /* compute the initial chaining values ctx->X[], based on key */ 545 + /* compute the initial chaining values ctx->x[], based on key */ 546 546 if (key_bytes == 0) { /* is there a key? */ 547 547 /* no key: use all zeroes as key for config block */ 548 - memset(ctx->X, 0, sizeof(ctx->X)); 548 + memset(ctx->x, 0, sizeof(ctx->x)); 549 549 } else { /* here to pre-process a key */ 550 - skein_assert(sizeof(cfg.b) >= sizeof(ctx->X)); 550 + skein_assert(sizeof(cfg.b) >= sizeof(ctx->x)); 551 551 /* do a mini-Init right here */ 552 552 /* set output hash bit count = state size */ 553 - ctx->h.hash_bit_len = 8*sizeof(ctx->X); 553 + ctx->h.hash_bit_len = 8*sizeof(ctx->x); 554 554 /* set tweaks: T0 = 0; T1 = KEY type */ 555 555 skein_start_new_type(ctx, KEY); 556 556 /* zero the initial chaining variables */ 557 - memset(ctx->X, 0, sizeof(ctx->X)); 557 + memset(ctx->x, 0, sizeof(ctx->x)); 558 558 /* hash the key */ 559 559 skein_1024_update(ctx, key, key_bytes); 560 560 /* put result into cfg.b[] */ 561 561 skein_1024_final_pad(ctx, cfg.b); 562 - /* copy over into ctx->X[] */ 563 - memcpy(ctx->X, cfg.b, sizeof(cfg.b)); 562 + /* copy over into ctx->x[] */ 563 + memcpy(ctx->x, cfg.b, sizeof(cfg.b)); 564 564 } 565 565 /* 566 566 * build/process the config block, type == CONFIG (could be ··· 583 583 /* compute the initial chaining values from config block */ 584 584 skein_1024_process_block(ctx, cfg.b, 1, SKEIN_CFG_STR_LEN); 585 585 586 - /* The chaining vars ctx->X are now initialized */ 586 + /* The chaining vars ctx->x are now initialized */ 587 587 /* Set up to process the data message portion of the hash (default) */ 588 588 skein_start_new_type(ctx, MSG); 589 589 ··· 650 650 int skein_1024_final(struct skein_1024_ctx *ctx, u8 *hash_val) 651 651 { 652 652 size_t i, n, byte_cnt; 653 - u64 X[SKEIN_1024_STATE_WORDS]; 653 + u64 x[SKEIN_1024_STATE_WORDS]; 654 654 /* catch uninitialized context */ 655 655 skein_assert_ret(ctx->h.b_cnt <= SKEIN_1024_BLOCK_BYTES, SKEIN_FAIL); 656 656 657 657 /* tag as the final block */ 658 - ctx->h.T[1] |= SKEIN_T1_FLAG_FINAL; 658 + ctx->h.tweak[1] |= SKEIN_T1_FLAG_FINAL; 659 659 /* zero pad b[] if necessary */ 660 660 if (ctx->h.b_cnt < SKEIN_1024_BLOCK_BYTES) 661 661 memset(&ctx->b[ctx->h.b_cnt], 0, ··· 672 672 /* zero out b[], so it can hold the counter */ 673 673 memset(ctx->b, 0, sizeof(ctx->b)); 674 674 /* keep a local copy of counter mode "key" */ 675 - memcpy(X, ctx->X, sizeof(X)); 675 + memcpy(x, ctx->x, sizeof(x)); 676 676 for (i = 0; i*SKEIN_1024_BLOCK_BYTES < byte_cnt; i++) { 677 677 /* build the counter block */ 678 678 ((u64 *)ctx->b)[0] = skein_swap64((u64) i); ··· 684 684 if (n >= SKEIN_1024_BLOCK_BYTES) 685 685 n = SKEIN_1024_BLOCK_BYTES; 686 686 /* "output" the ctr mode bytes */ 687 - skein_put64_lsb_first(hash_val+i*SKEIN_1024_BLOCK_BYTES, ctx->X, 687 + skein_put64_lsb_first(hash_val+i*SKEIN_1024_BLOCK_BYTES, ctx->x, 688 688 n); 689 689 skein_show_final(1024, &ctx->h, n, 690 690 hash_val+i*SKEIN_1024_BLOCK_BYTES); 691 691 /* restore the counter mode key for next time */ 692 - memcpy(ctx->X, X, sizeof(X)); 692 + memcpy(ctx->x, x, sizeof(x)); 693 693 } 694 694 return SKEIN_SUCCESS; 695 695 } ··· 705 705 skein_assert_ret(ctx->h.b_cnt <= SKEIN_256_BLOCK_BYTES, SKEIN_FAIL); 706 706 707 707 /* tag as the final block */ 708 - ctx->h.T[1] |= SKEIN_T1_FLAG_FINAL; 708 + ctx->h.tweak[1] |= SKEIN_T1_FLAG_FINAL; 709 709 /* zero pad b[] if necessary */ 710 710 if (ctx->h.b_cnt < SKEIN_256_BLOCK_BYTES) 711 711 memset(&ctx->b[ctx->h.b_cnt], 0, ··· 714 714 skein_256_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); 715 715 716 716 /* "output" the state bytes */ 717 - skein_put64_lsb_first(hash_val, ctx->X, SKEIN_256_BLOCK_BYTES); 717 + skein_put64_lsb_first(hash_val, ctx->x, SKEIN_256_BLOCK_BYTES); 718 718 719 719 return SKEIN_SUCCESS; 720 720 } ··· 727 727 skein_assert_ret(ctx->h.b_cnt <= SKEIN_512_BLOCK_BYTES, SKEIN_FAIL); 728 728 729 729 /* tag as the final block */ 730 - ctx->h.T[1] |= SKEIN_T1_FLAG_FINAL; 730 + ctx->h.tweak[1] |= SKEIN_T1_FLAG_FINAL; 731 731 /* zero pad b[] if necessary */ 732 732 if (ctx->h.b_cnt < SKEIN_512_BLOCK_BYTES) 733 733 memset(&ctx->b[ctx->h.b_cnt], 0, ··· 736 736 skein_512_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); 737 737 738 738 /* "output" the state bytes */ 739 - skein_put64_lsb_first(hash_val, ctx->X, SKEIN_512_BLOCK_BYTES); 739 + skein_put64_lsb_first(hash_val, ctx->x, SKEIN_512_BLOCK_BYTES); 740 740 741 741 return SKEIN_SUCCESS; 742 742 } ··· 749 749 skein_assert_ret(ctx->h.b_cnt <= SKEIN_1024_BLOCK_BYTES, SKEIN_FAIL); 750 750 751 751 /* tag as the final block */ 752 - ctx->h.T[1] |= SKEIN_T1_FLAG_FINAL; 752 + ctx->h.tweak[1] |= SKEIN_T1_FLAG_FINAL; 753 753 /* zero pad b[] if necessary */ 754 754 if (ctx->h.b_cnt < SKEIN_1024_BLOCK_BYTES) 755 755 memset(&ctx->b[ctx->h.b_cnt], 0, ··· 758 758 skein_1024_process_block(ctx, ctx->b, 1, ctx->h.b_cnt); 759 759 760 760 /* "output" the state bytes */ 761 - skein_put64_lsb_first(hash_val, ctx->X, SKEIN_1024_BLOCK_BYTES); 761 + skein_put64_lsb_first(hash_val, ctx->x, SKEIN_1024_BLOCK_BYTES); 762 762 763 763 return SKEIN_SUCCESS; 764 764 } ··· 769 769 int skein_256_output(struct skein_256_ctx *ctx, u8 *hash_val) 770 770 { 771 771 size_t i, n, byte_cnt; 772 - u64 X[SKEIN_256_STATE_WORDS]; 772 + u64 x[SKEIN_256_STATE_WORDS]; 773 773 /* catch uninitialized context */ 774 774 skein_assert_ret(ctx->h.b_cnt <= SKEIN_256_BLOCK_BYTES, SKEIN_FAIL); 775 775 ··· 781 781 /* zero out b[], so it can hold the counter */ 782 782 memset(ctx->b, 0, sizeof(ctx->b)); 783 783 /* keep a local copy of counter mode "key" */ 784 - memcpy(X, ctx->X, sizeof(X)); 784 + memcpy(x, ctx->x, sizeof(x)); 785 785 for (i = 0; i*SKEIN_256_BLOCK_BYTES < byte_cnt; i++) { 786 786 /* build the counter block */ 787 787 ((u64 *)ctx->b)[0] = skein_swap64((u64) i); ··· 793 793 if (n >= SKEIN_256_BLOCK_BYTES) 794 794 n = SKEIN_256_BLOCK_BYTES; 795 795 /* "output" the ctr mode bytes */ 796 - skein_put64_lsb_first(hash_val+i*SKEIN_256_BLOCK_BYTES, ctx->X, 796 + skein_put64_lsb_first(hash_val+i*SKEIN_256_BLOCK_BYTES, ctx->x, 797 797 n); 798 798 skein_show_final(256, &ctx->h, n, 799 799 hash_val+i*SKEIN_256_BLOCK_BYTES); 800 800 /* restore the counter mode key for next time */ 801 - memcpy(ctx->X, X, sizeof(X)); 801 + memcpy(ctx->x, x, sizeof(x)); 802 802 } 803 803 return SKEIN_SUCCESS; 804 804 } ··· 808 808 int skein_512_output(struct skein_512_ctx *ctx, u8 *hash_val) 809 809 { 810 810 size_t i, n, byte_cnt; 811 - u64 X[SKEIN_512_STATE_WORDS]; 811 + u64 x[SKEIN_512_STATE_WORDS]; 812 812 /* catch uninitialized context */ 813 813 skein_assert_ret(ctx->h.b_cnt <= SKEIN_512_BLOCK_BYTES, SKEIN_FAIL); 814 814 ··· 820 820 /* zero out b[], so it can hold the counter */ 821 821 memset(ctx->b, 0, sizeof(ctx->b)); 822 822 /* keep a local copy of counter mode "key" */ 823 - memcpy(X, ctx->X, sizeof(X)); 823 + memcpy(x, ctx->x, sizeof(x)); 824 824 for (i = 0; i*SKEIN_512_BLOCK_BYTES < byte_cnt; i++) { 825 825 /* build the counter block */ 826 826 ((u64 *)ctx->b)[0] = skein_swap64((u64) i); ··· 832 832 if (n >= SKEIN_512_BLOCK_BYTES) 833 833 n = SKEIN_512_BLOCK_BYTES; 834 834 /* "output" the ctr mode bytes */ 835 - skein_put64_lsb_first(hash_val+i*SKEIN_512_BLOCK_BYTES, ctx->X, 835 + skein_put64_lsb_first(hash_val+i*SKEIN_512_BLOCK_BYTES, ctx->x, 836 836 n); 837 837 skein_show_final(256, &ctx->h, n, 838 838 hash_val+i*SKEIN_512_BLOCK_BYTES); 839 839 /* restore the counter mode key for next time */ 840 - memcpy(ctx->X, X, sizeof(X)); 840 + memcpy(ctx->x, x, sizeof(x)); 841 841 } 842 842 return SKEIN_SUCCESS; 843 843 } ··· 847 847 int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val) 848 848 { 849 849 size_t i, n, byte_cnt; 850 - u64 X[SKEIN_1024_STATE_WORDS]; 850 + u64 x[SKEIN_1024_STATE_WORDS]; 851 851 /* catch uninitialized context */ 852 852 skein_assert_ret(ctx->h.b_cnt <= SKEIN_1024_BLOCK_BYTES, SKEIN_FAIL); 853 853 ··· 859 859 /* zero out b[], so it can hold the counter */ 860 860 memset(ctx->b, 0, sizeof(ctx->b)); 861 861 /* keep a local copy of counter mode "key" */ 862 - memcpy(X, ctx->X, sizeof(X)); 862 + memcpy(x, ctx->x, sizeof(x)); 863 863 for (i = 0; i*SKEIN_1024_BLOCK_BYTES < byte_cnt; i++) { 864 864 /* build the counter block */ 865 865 ((u64 *)ctx->b)[0] = skein_swap64((u64) i); ··· 871 871 if (n >= SKEIN_1024_BLOCK_BYTES) 872 872 n = SKEIN_1024_BLOCK_BYTES; 873 873 /* "output" the ctr mode bytes */ 874 - skein_put64_lsb_first(hash_val+i*SKEIN_1024_BLOCK_BYTES, ctx->X, 874 + skein_put64_lsb_first(hash_val+i*SKEIN_1024_BLOCK_BYTES, ctx->x, 875 875 n); 876 876 skein_show_final(256, &ctx->h, n, 877 877 hash_val+i*SKEIN_1024_BLOCK_BYTES); 878 878 /* restore the counter mode key for next time */ 879 - memcpy(ctx->X, X, sizeof(X)); 879 + memcpy(ctx->x, x, sizeof(x)); 880 880 } 881 881 return SKEIN_SUCCESS; 882 882 }
+17 -17
drivers/staging/skein/skein.h
··· 66 66 struct skein_ctx_hdr { 67 67 size_t hash_bit_len; /* size of hash result, in bits */ 68 68 size_t b_cnt; /* current byte count in buffer b[] */ 69 - u64 T[SKEIN_MODIFIER_WORDS]; /* tweak: T[0]=byte cnt, T[1]=flags */ 69 + u64 tweak[SKEIN_MODIFIER_WORDS]; /* tweak[0]=byte cnt, tweak[1]=flags */ 70 70 }; 71 71 72 72 struct skein_256_ctx { /* 256-bit Skein hash context structure */ 73 73 struct skein_ctx_hdr h; /* common header context variables */ 74 - u64 X[SKEIN_256_STATE_WORDS]; /* chaining variables */ 74 + u64 x[SKEIN_256_STATE_WORDS]; /* chaining variables */ 75 75 u8 b[SKEIN_256_BLOCK_BYTES]; /* partial block buf (8-byte aligned) */ 76 76 }; 77 77 78 78 struct skein_512_ctx { /* 512-bit Skein hash context structure */ 79 79 struct skein_ctx_hdr h; /* common header context variables */ 80 - u64 X[SKEIN_512_STATE_WORDS]; /* chaining variables */ 80 + u64 x[SKEIN_512_STATE_WORDS]; /* chaining variables */ 81 81 u8 b[SKEIN_512_BLOCK_BYTES]; /* partial block buf (8-byte aligned) */ 82 82 }; 83 83 84 84 struct skein_1024_ctx { /* 1024-bit Skein hash context structure */ 85 85 struct skein_ctx_hdr h; /* common header context variables */ 86 - u64 X[SKEIN_1024_STATE_WORDS]; /* chaining variables */ 86 + u64 x[SKEIN_1024_STATE_WORDS]; /* chaining variables */ 87 87 u8 b[SKEIN_1024_BLOCK_BYTES]; /* partial block buf (8-byte aligned) */ 88 88 }; 89 89 ··· 150 150 ** reference and optimized code. 151 151 ******************************************************************/ 152 152 153 - /* tweak word T[1]: bit field starting positions */ 153 + /* tweak word tweak[1]: bit field starting positions */ 154 154 #define SKEIN_T1_BIT(BIT) ((BIT) - 64) /* second word */ 155 155 156 156 #define SKEIN_T1_POS_TREE_LVL SKEIN_T1_BIT(112) /* 112..118 hash tree level */ ··· 159 159 #define SKEIN_T1_POS_FIRST SKEIN_T1_BIT(126) /* 126 first blk flag */ 160 160 #define SKEIN_T1_POS_FINAL SKEIN_T1_BIT(127) /* 127 final blk flag */ 161 161 162 - /* tweak word T[1]: flag bit definition(s) */ 162 + /* tweak word tweak[1]: flag bit definition(s) */ 163 163 #define SKEIN_T1_FLAG_FIRST (((u64) 1) << SKEIN_T1_POS_FIRST) 164 164 #define SKEIN_T1_FLAG_FINAL (((u64) 1) << SKEIN_T1_POS_FINAL) 165 165 #define SKEIN_T1_FLAG_BIT_PAD (((u64) 1) << SKEIN_T1_POS_BIT_PAD) 166 166 167 - /* tweak word T[1]: tree level bit field mask */ 167 + /* tweak word tweak[1]: tree level bit field mask */ 168 168 #define SKEIN_T1_TREE_LVL_MASK (((u64)0x7F) << SKEIN_T1_POS_TREE_LVL) 169 169 #define SKEIN_T1_TREE_LEVEL(n) (((u64) (n)) << SKEIN_T1_POS_TREE_LVL) 170 170 171 - /* tweak word T[1]: block type field */ 171 + /* tweak word tweak[1]: block type field */ 172 172 #define SKEIN_BLK_TYPE_KEY (0) /* key, for MAC and KDF */ 173 173 #define SKEIN_BLK_TYPE_CFG (4) /* configuration block */ 174 174 #define SKEIN_BLK_TYPE_PERS (8) /* personalization string */ ··· 232 232 ** Skein macros for getting/setting tweak words, etc. 233 233 ** These are useful for partial input bytes, hash tree init/update, etc. 234 234 **/ 235 - #define skein_get_tweak(ctx_ptr, TWK_NUM) ((ctx_ptr)->h.T[TWK_NUM]) 235 + #define skein_get_tweak(ctx_ptr, TWK_NUM) ((ctx_ptr)->h.tweak[TWK_NUM]) 236 236 #define skein_set_tweak(ctx_ptr, TWK_NUM, t_val) { \ 237 - (ctx_ptr)->h.T[TWK_NUM] = (t_val); \ 237 + (ctx_ptr)->h.tweak[TWK_NUM] = (t_val); \ 238 238 } 239 239 240 240 #define skein_get_T0(ctx_ptr) skein_get_tweak(ctx_ptr, 0) ··· 254 254 255 255 /* 256 256 * setup for starting with a new type: 257 - * h.T[0]=0; h.T[1] = NEW_TYPE; h.b_cnt=0; 257 + * h.tweak[0]=0; h.tweak[1] = NEW_TYPE; h.b_cnt=0; 258 258 */ 259 259 #define skein_start_new_type(ctx_ptr, BLK_TYPE) { \ 260 260 skein_set_T0_T1(ctx_ptr, 0, SKEIN_T1_FLAG_FIRST | \ ··· 263 263 } 264 264 265 265 #define skein_clear_first_flag(hdr) { \ 266 - (hdr).T[1] &= ~SKEIN_T1_FLAG_FIRST; \ 266 + (hdr).tweak[1] &= ~SKEIN_T1_FLAG_FIRST; \ 267 267 } 268 268 #define skein_set_bit_pad_flag(hdr) { \ 269 - (hdr).T[1] |= SKEIN_T1_FLAG_BIT_PAD; \ 269 + (hdr).tweak[1] |= SKEIN_T1_FLAG_BIT_PAD; \ 270 270 } 271 271 272 272 #define skein_set_tree_level(hdr, height) { \ 273 - (hdr).T[1] |= SKEIN_T1_TREE_LEVEL(height); \ 273 + (hdr).tweak[1] |= SKEIN_T1_TREE_LEVEL(height); \ 274 274 } 275 275 276 276 /***************************************************************** ··· 279 279 #ifdef SKEIN_DEBUG /* examine/display intermediate values? */ 280 280 #include "skein_debug.h" 281 281 #else /* default is no callouts */ 282 - #define skein_show_block(bits, ctx, X, blk_ptr, w_ptr, ks_event_ptr, ks_odd_ptr) 283 - #define skein_show_round(bits, ctx, r, X) 284 - #define skein_show_r_ptr(bits, ctx, r, X_ptr) 282 + #define skein_show_block(bits, ctx, x, blk_ptr, w_ptr, ks_event_ptr, ks_odd_ptr) 283 + #define skein_show_round(bits, ctx, r, x) 284 + #define skein_show_r_ptr(bits, ctx, r, x_ptr) 285 285 #define skein_show_final(bits, ctx, cnt, out_ptr) 286 286 #define skein_show_key(bits, ctx, key, key_bytes) 287 287 #endif
+16 -16
drivers/staging/skein/skein_api.c
··· 40 40 int skein_init(struct skein_ctx *ctx, size_t hash_bit_len) 41 41 { 42 42 int ret = SKEIN_FAIL; 43 - size_t X_len = 0; 44 - u64 *X = NULL; 43 + size_t x_len = 0; 44 + u64 *x = NULL; 45 45 u64 tree_info = SKEIN_CFG_TREE_INFO_SEQUENTIAL; 46 46 47 47 skein_assert_ret(ctx, SKEIN_FAIL); ··· 50 50 * contexts are a union in out context and thus have tha maximum 51 51 * memory available. The beauty of C :-) . 52 52 */ 53 - X = ctx->m.s256.X; 54 - X_len = ctx->skein_size/8; 53 + x = ctx->m.s256.x; 54 + x_len = ctx->skein_size/8; 55 55 /* 56 56 * If size is the same and hash bit length is zero then reuse 57 57 * the save chaining variables. ··· 76 76 * Save chaining variables for this combination of size and 77 77 * hash_bit_len 78 78 */ 79 - memcpy(ctx->X_save, X, X_len); 79 + memcpy(ctx->x_save, x, x_len); 80 80 } 81 81 return ret; 82 82 } ··· 85 85 size_t hash_bit_len) 86 86 { 87 87 int ret = SKEIN_FAIL; 88 - u64 *X = NULL; 89 - size_t X_len = 0; 88 + u64 *x = NULL; 89 + size_t x_len = 0; 90 90 u64 tree_info = SKEIN_CFG_TREE_INFO_SEQUENTIAL; 91 91 92 92 skein_assert_ret(ctx, SKEIN_FAIL); 93 93 94 - X = ctx->m.s256.X; 95 - X_len = ctx->skein_size/8; 94 + x = ctx->m.s256.x; 95 + x_len = ctx->skein_size/8; 96 96 97 97 skein_assert_ret(hash_bit_len, SKEIN_BAD_HASHLEN); 98 98 ··· 120 120 * Save chaining variables for this combination of key, 121 121 * key_len, hash_bit_len 122 122 */ 123 - memcpy(ctx->X_save, X, X_len); 123 + memcpy(ctx->x_save, x, x_len); 124 124 } 125 125 return ret; 126 126 } 127 127 128 128 void skein_reset(struct skein_ctx *ctx) 129 129 { 130 - size_t X_len = 0; 131 - u64 *X = NULL; 130 + size_t x_len = 0; 131 + u64 *x = NULL; 132 132 133 133 /* 134 134 * The following two lines rely of the fact that the real Skein 135 135 * contexts are a union in out context and thus have tha maximum 136 136 * memory available. The beautiy of C :-) . 137 137 */ 138 - X = ctx->m.s256.X; 139 - X_len = ctx->skein_size/8; 138 + x = ctx->m.s256.x; 139 + x_len = ctx->skein_size/8; 140 140 /* Restore the chaing variable, reset byte counter */ 141 - memcpy(X, ctx->X_save, X_len); 141 + memcpy(x, ctx->x_save, x_len); 142 142 143 143 /* Setup context to process the message */ 144 144 skein_start_new_type(&ctx->m, MSG); ··· 200 200 * Skein's real partial block buffer. 201 201 * If this layout ever changes we have to adapt this as well. 202 202 */ 203 - up = (u8 *)ctx->m.s256.X + ctx->skein_size / 8; 203 + up = (u8 *)ctx->m.s256.x + ctx->skein_size / 8; 204 204 205 205 /* set tweak flag for the skein_final call */ 206 206 skein_set_bit_pad_flag(ctx->m.h);
+1 -1
drivers/staging/skein/skein_api.h
··· 100 100 */ 101 101 struct skein_ctx { 102 102 u64 skein_size; 103 - u64 X_save[SKEIN_MAX_STATE_WORDS]; /* save area for state variables */ 103 + u64 x_save[SKEIN_MAX_STATE_WORDS]; /* save area for state variables */ 104 104 union { 105 105 struct skein_ctx_hdr h; 106 106 struct skein_256_ctx s256;
+77 -76
drivers/staging/skein/skein_block.c
··· 32 32 #define ts (kw + KW_TWK_BASE) 33 33 34 34 #ifdef SKEIN_DEBUG 35 - #define debug_save_tweak(ctx) { ctx->h.T[0] = ts[0]; ctx->h.T[1] = ts[1]; } 35 + #define debug_save_tweak(ctx) { \ 36 + ctx->h.tweak[0] = ts[0]; ctx->h.tweak[1] = ts[1]; } 36 37 #else 37 38 #define debug_save_tweak(ctx) 38 39 #endif ··· 72 71 X_ptr[0] = &X0; X_ptr[1] = &X1; X_ptr[2] = &X2; X_ptr[3] = &X3; 73 72 #endif 74 73 skein_assert(blk_cnt != 0); /* never call with blk_cnt == 0! */ 75 - ts[0] = ctx->h.T[0]; 76 - ts[1] = ctx->h.T[1]; 74 + ts[0] = ctx->h.tweak[0]; 75 + ts[1] = ctx->h.tweak[1]; 77 76 do { 78 77 /* 79 78 * this implementation only supports 2**64 input bytes ··· 82 81 ts[0] += byte_cnt_add; /* update processed length */ 83 82 84 83 /* precompute the key schedule for this block */ 85 - ks[0] = ctx->X[0]; 86 - ks[1] = ctx->X[1]; 87 - ks[2] = ctx->X[2]; 88 - ks[3] = ctx->X[3]; 84 + ks[0] = ctx->x[0]; 85 + ks[1] = ctx->x[1]; 86 + ks[2] = ctx->x[2]; 87 + ks[3] = ctx->x[3]; 89 88 ks[4] = ks[0] ^ ks[1] ^ ks[2] ^ ks[3] ^ SKEIN_KS_PARITY; 90 89 91 90 ts[2] = ts[0] ^ ts[1]; ··· 93 92 /* get input block in little-endian format */ 94 93 skein_get64_lsb_first(w, blk_ptr, WCNT); 95 94 debug_save_tweak(ctx); 96 - skein_show_block(BLK_BITS, &ctx->h, ctx->X, blk_ptr, w, ks, ts); 95 + skein_show_block(BLK_BITS, &ctx->h, ctx->x, blk_ptr, w, ks, ts); 97 96 98 97 X0 = w[0] + ks[0]; /* do the first full key injection */ 99 98 X1 = w[1] + ks[1] + ts[0]; ··· 102 101 103 102 /* show starting state values */ 104 103 skein_show_r_ptr(BLK_BITS, &ctx->h, SKEIN_RND_KEY_INITIAL, 105 - X_ptr); 104 + x_ptr); 106 105 107 106 blk_ptr += SKEIN_256_BLOCK_BYTES; 108 107 ··· 221 220 #endif 222 221 } 223 222 /* do the final "feedforward" xor, update context chaining */ 224 - ctx->X[0] = X0 ^ w[0]; 225 - ctx->X[1] = X1 ^ w[1]; 226 - ctx->X[2] = X2 ^ w[2]; 227 - ctx->X[3] = X3 ^ w[3]; 223 + ctx->x[0] = X0 ^ w[0]; 224 + ctx->x[1] = X1 ^ w[1]; 225 + ctx->x[2] = X2 ^ w[2]; 226 + ctx->x[3] = X3 ^ w[3]; 228 227 229 - skein_show_round(BLK_BITS, &ctx->h, SKEIN_RND_FEED_FWD, ctx->X); 228 + skein_show_round(BLK_BITS, &ctx->h, SKEIN_RND_FEED_FWD, ctx->x); 230 229 231 230 ts[1] &= ~SKEIN_T1_FLAG_FIRST; 232 231 } while (--blk_cnt); 233 - ctx->h.T[0] = ts[0]; 234 - ctx->h.T[1] = ts[1]; 232 + ctx->h.tweak[0] = ts[0]; 233 + ctx->h.tweak[1] = ts[1]; 235 234 } 236 235 237 236 #if defined(SKEIN_CODE_SIZE) || defined(SKEIN_PERF) ··· 283 282 #endif 284 283 285 284 skein_assert(blk_cnt != 0); /* never call with blk_cnt == 0! */ 286 - ts[0] = ctx->h.T[0]; 287 - ts[1] = ctx->h.T[1]; 285 + ts[0] = ctx->h.tweak[0]; 286 + ts[1] = ctx->h.tweak[1]; 288 287 do { 289 288 /* 290 289 * this implementation only supports 2**64 input bytes ··· 293 292 ts[0] += byte_cnt_add; /* update processed length */ 294 293 295 294 /* precompute the key schedule for this block */ 296 - ks[0] = ctx->X[0]; 297 - ks[1] = ctx->X[1]; 298 - ks[2] = ctx->X[2]; 299 - ks[3] = ctx->X[3]; 300 - ks[4] = ctx->X[4]; 301 - ks[5] = ctx->X[5]; 302 - ks[6] = ctx->X[6]; 303 - ks[7] = ctx->X[7]; 295 + ks[0] = ctx->x[0]; 296 + ks[1] = ctx->x[1]; 297 + ks[2] = ctx->x[2]; 298 + ks[3] = ctx->x[3]; 299 + ks[4] = ctx->x[4]; 300 + ks[5] = ctx->x[5]; 301 + ks[6] = ctx->x[6]; 302 + ks[7] = ctx->x[7]; 304 303 ks[8] = ks[0] ^ ks[1] ^ ks[2] ^ ks[3] ^ 305 304 ks[4] ^ ks[5] ^ ks[6] ^ ks[7] ^ SKEIN_KS_PARITY; 306 305 ··· 309 308 /* get input block in little-endian format */ 310 309 skein_get64_lsb_first(w, blk_ptr, WCNT); 311 310 debug_save_tweak(ctx); 312 - skein_show_block(BLK_BITS, &ctx->h, ctx->X, blk_ptr, w, ks, ts); 311 + skein_show_block(BLK_BITS, &ctx->h, ctx->x, blk_ptr, w, ks, ts); 313 312 314 313 X0 = w[0] + ks[0]; /* do the first full key injection */ 315 314 X1 = w[1] + ks[1]; ··· 449 448 } 450 449 451 450 /* do the final "feedforward" xor, update context chaining */ 452 - ctx->X[0] = X0 ^ w[0]; 453 - ctx->X[1] = X1 ^ w[1]; 454 - ctx->X[2] = X2 ^ w[2]; 455 - ctx->X[3] = X3 ^ w[3]; 456 - ctx->X[4] = X4 ^ w[4]; 457 - ctx->X[5] = X5 ^ w[5]; 458 - ctx->X[6] = X6 ^ w[6]; 459 - ctx->X[7] = X7 ^ w[7]; 460 - skein_show_round(BLK_BITS, &ctx->h, SKEIN_RND_FEED_FWD, ctx->X); 451 + ctx->x[0] = X0 ^ w[0]; 452 + ctx->x[1] = X1 ^ w[1]; 453 + ctx->x[2] = X2 ^ w[2]; 454 + ctx->x[3] = X3 ^ w[3]; 455 + ctx->x[4] = X4 ^ w[4]; 456 + ctx->x[5] = X5 ^ w[5]; 457 + ctx->x[6] = X6 ^ w[6]; 458 + ctx->x[7] = X7 ^ w[7]; 459 + skein_show_round(BLK_BITS, &ctx->h, SKEIN_RND_FEED_FWD, ctx->x); 461 460 462 461 ts[1] &= ~SKEIN_T1_FLAG_FIRST; 463 462 } while (--blk_cnt); 464 - ctx->h.T[0] = ts[0]; 465 - ctx->h.T[1] = ts[1]; 463 + ctx->h.tweak[0] = ts[0]; 464 + ctx->h.tweak[1] = ts[1]; 466 465 } 467 466 468 467 #if defined(SKEIN_CODE_SIZE) || defined(SKEIN_PERF) ··· 521 520 #endif 522 521 523 522 skein_assert(blk_cnt != 0); /* never call with blk_cnt == 0! */ 524 - ts[0] = ctx->h.T[0]; 525 - ts[1] = ctx->h.T[1]; 523 + ts[0] = ctx->h.tweak[0]; 524 + ts[1] = ctx->h.tweak[1]; 526 525 do { 527 526 /* 528 527 * this implementation only supports 2**64 input bytes ··· 531 530 ts[0] += byte_cnt_add; /* update processed length */ 532 531 533 532 /* precompute the key schedule for this block */ 534 - ks[0] = ctx->X[0]; 535 - ks[1] = ctx->X[1]; 536 - ks[2] = ctx->X[2]; 537 - ks[3] = ctx->X[3]; 538 - ks[4] = ctx->X[4]; 539 - ks[5] = ctx->X[5]; 540 - ks[6] = ctx->X[6]; 541 - ks[7] = ctx->X[7]; 542 - ks[8] = ctx->X[8]; 543 - ks[9] = ctx->X[9]; 544 - ks[10] = ctx->X[10]; 545 - ks[11] = ctx->X[11]; 546 - ks[12] = ctx->X[12]; 547 - ks[13] = ctx->X[13]; 548 - ks[14] = ctx->X[14]; 549 - ks[15] = ctx->X[15]; 533 + ks[0] = ctx->x[0]; 534 + ks[1] = ctx->x[1]; 535 + ks[2] = ctx->x[2]; 536 + ks[3] = ctx->x[3]; 537 + ks[4] = ctx->x[4]; 538 + ks[5] = ctx->x[5]; 539 + ks[6] = ctx->x[6]; 540 + ks[7] = ctx->x[7]; 541 + ks[8] = ctx->x[8]; 542 + ks[9] = ctx->x[9]; 543 + ks[10] = ctx->x[10]; 544 + ks[11] = ctx->x[11]; 545 + ks[12] = ctx->x[12]; 546 + ks[13] = ctx->x[13]; 547 + ks[14] = ctx->x[14]; 548 + ks[15] = ctx->x[15]; 550 549 ks[16] = ks[0] ^ ks[1] ^ ks[2] ^ ks[3] ^ 551 550 ks[4] ^ ks[5] ^ ks[6] ^ ks[7] ^ 552 551 ks[8] ^ ks[9] ^ ks[10] ^ ks[11] ^ ··· 557 556 /* get input block in little-endian format */ 558 557 skein_get64_lsb_first(w, blk_ptr, WCNT); 559 558 debug_save_tweak(ctx); 560 - skein_show_block(BLK_BITS, &ctx->h, ctx->X, blk_ptr, w, ks, ts); 559 + skein_show_block(BLK_BITS, &ctx->h, ctx->x, blk_ptr, w, ks, ts); 561 560 562 561 X00 = w[0] + ks[0]; /* do the first full key injection */ 563 562 X01 = w[1] + ks[1]; ··· 736 735 } 737 736 /* do the final "feedforward" xor, update context chaining */ 738 737 739 - ctx->X[0] = X00 ^ w[0]; 740 - ctx->X[1] = X01 ^ w[1]; 741 - ctx->X[2] = X02 ^ w[2]; 742 - ctx->X[3] = X03 ^ w[3]; 743 - ctx->X[4] = X04 ^ w[4]; 744 - ctx->X[5] = X05 ^ w[5]; 745 - ctx->X[6] = X06 ^ w[6]; 746 - ctx->X[7] = X07 ^ w[7]; 747 - ctx->X[8] = X08 ^ w[8]; 748 - ctx->X[9] = X09 ^ w[9]; 749 - ctx->X[10] = X10 ^ w[10]; 750 - ctx->X[11] = X11 ^ w[11]; 751 - ctx->X[12] = X12 ^ w[12]; 752 - ctx->X[13] = X13 ^ w[13]; 753 - ctx->X[14] = X14 ^ w[14]; 754 - ctx->X[15] = X15 ^ w[15]; 738 + ctx->x[0] = X00 ^ w[0]; 739 + ctx->x[1] = X01 ^ w[1]; 740 + ctx->x[2] = X02 ^ w[2]; 741 + ctx->x[3] = X03 ^ w[3]; 742 + ctx->x[4] = X04 ^ w[4]; 743 + ctx->x[5] = X05 ^ w[5]; 744 + ctx->x[6] = X06 ^ w[6]; 745 + ctx->x[7] = X07 ^ w[7]; 746 + ctx->x[8] = X08 ^ w[8]; 747 + ctx->x[9] = X09 ^ w[9]; 748 + ctx->x[10] = X10 ^ w[10]; 749 + ctx->x[11] = X11 ^ w[11]; 750 + ctx->x[12] = X12 ^ w[12]; 751 + ctx->x[13] = X13 ^ w[13]; 752 + ctx->x[14] = X14 ^ w[14]; 753 + ctx->x[15] = X15 ^ w[15]; 755 754 756 - skein_show_round(BLK_BITS, &ctx->h, SKEIN_RND_FEED_FWD, ctx->X); 755 + skein_show_round(BLK_BITS, &ctx->h, SKEIN_RND_FEED_FWD, ctx->x); 757 756 758 757 ts[1] &= ~SKEIN_T1_FLAG_FIRST; 759 758 blk_ptr += SKEIN_1024_BLOCK_BYTES; 760 759 } while (--blk_cnt); 761 - ctx->h.T[0] = ts[0]; 762 - ctx->h.T[1] = ts[1]; 760 + ctx->h.tweak[0] = ts[0]; 761 + ctx->h.tweak[1] = ts[1]; 763 762 } 764 763 765 764 #if defined(SKEIN_CODE_SIZE) || defined(SKEIN_PERF)