aboutsummaryrefslogtreecommitdiff
path: root/src/xz/xz_w32res.rc
blob: bad302029913c3bf836bb3013bb8a9df8d99e674 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
/*
 * Author: Lasse Collin
 *
 * This file has been put into the public domain.
 * You can do whatever you want with this file.
 */

#define MY_TYPE VFT_APP
#define MY_NAME "xz"
#define MY_SUFFIX ".exe"
#define MY_DESC "xz data compression tool for .xz and .lzma files"
#include "common_w32res.rc"
lower_value, temp); COLUMN(x,y, 6, 8, 12, 0, 4, 7, 11, 15, 3, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); COLUMN(x,y, 8, 10, 14, 2, 6, 9, 13, 1, 5, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); COLUMN(x,y,10, 12, 0, 4, 8, 11, 15, 3, 7, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); COLUMN(x,y,12, 14, 2, 6, 10, 13, 1, 5, 9, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); COLUMN(x,y,14, 0, 4, 8, 12, 15, 3, 7, 11, temp_v1, temp_v2, temp_upper_value, temp_lower_value, temp); } /* compute compression function (short variants) */ static void F512(uint32_t *h, const uint32_t *m) { int i; uint32_t Ptmp[2*COLS512]; uint32_t Qtmp[2*COLS512]; uint32_t y[2*COLS512]; uint32_t z[2*COLS512]; for (i = 0; i < 2*COLS512; i++) { z[i] = m[i]; Ptmp[i] = h[i]^m[i]; } /* compute Q(m) */ RND512Q((uint8_t*)z, y, SWAP32LE(0x00000000)); RND512Q((uint8_t*)y, z, SWAP32LE(0x01000000)); RND512Q((uint8_t*)z, y, SWAP32LE(0x02000000)); RND512Q((uint8_t*)y, z, SWAP32LE(0x03000000)); RND512Q((uint8_t*)z, y, SWAP32LE(0x04000000)); RND512Q((uint8_t*)y, z, SWAP32LE(0x05000000)); RND512Q((uint8_t*)z, y, SWAP32LE(0x06000000)); RND512Q((uint8_t*)y, z, SWAP32LE(0x07000000)); RND512Q((uint8_t*)z, y, SWAP32LE(0x08000000)); RND512Q((uint8_t*)y, Qtmp, SWAP32LE(0x09000000)); /* compute P(h+m) */ RND512P((uint8_t*)Ptmp, y, SWAP32LE(0x00000000)); RND512P((uint8_t*)y, z, SWAP32LE(0x00000001)); RND512P((uint8_t*)z, y, SWAP32LE(0x00000002)); RND512P((uint8_t*)y, z, SWAP32LE(0x00000003)); RND512P((uint8_t*)z, y, SWAP32LE(0x00000004)); RND512P((uint8_t*)y, z, SWAP32LE(0x00000005)); RND512P((uint8_t*)z, y, SWAP32LE(0x00000006)); RND512P((uint8_t*)y, z, SWAP32LE(0x00000007)); RND512P((uint8_t*)z, y, SWAP32LE(0x00000008)); RND512P((uint8_t*)y, Ptmp, SWAP32LE(0x00000009)); /* compute P(h+m) + Q(m) + h */ for (i = 0; i < 2*COLS512; i++) { h[i] ^= Ptmp[i]^Qtmp[i]; } } /* digest up to msglen bytes of input (full blocks only) */ static void Transform(hashState *ctx, const uint8_t *input, int msglen) { /* digest message, one block at a time */ for (; msglen >= SIZE512; msglen -= SIZE512, input += SIZE512) { F512(ctx->chaining,(uint32_t*)input); /* increment block counter */ ctx->block_counter1++; if (ctx->block_counter1 == 0) ctx->block_counter2++; } } /* given state h, do h <- P(h)+h */ static void OutputTransformation(hashState *ctx) { int j; uint32_t temp[2*COLS512]; uint32_t y[2*COLS512]; uint32_t z[2*COLS512]; for (j = 0; j < 2*COLS512; j++) { temp[j] = ctx->chaining[j]; } RND512P((uint8_t*)temp, y, SWAP32LE(0x00000000)); RND512P((uint8_t*)y, z, SWAP32LE(0x00000001)); RND512P((uint8_t*)z, y, SWAP32LE(0x00000002)); RND512P((uint8_t*)y, z, SWAP32LE(0x00000003)); RND512P((uint8_t*)z, y, SWAP32LE(0x00000004)); RND512P((uint8_t*)y, z, SWAP32LE(0x00000005)); RND512P((uint8_t*)z, y, SWAP32LE(0x00000006)); RND512P((uint8_t*)y, z, SWAP32LE(0x00000007)); RND512P((uint8_t*)z, y, SWAP32LE(0x00000008)); RND512P((uint8_t*)y, temp, SWAP32LE(0x000