mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 13:04:42 +00:00
Merge pull request #4136 from libgit2/ethomson/sha1dc
Introduce (optional) SHA1 collision attack detection
This commit is contained in:
commit
3348570a0c
@ -37,6 +37,7 @@ OPTION( PROFILE "Generate profiling information" OFF )
|
|||||||
OPTION( ENABLE_TRACE "Enables tracing support" OFF )
|
OPTION( ENABLE_TRACE "Enables tracing support" OFF )
|
||||||
OPTION( LIBGIT2_FILENAME "Name of the produced binary" OFF )
|
OPTION( LIBGIT2_FILENAME "Name of the produced binary" OFF )
|
||||||
|
|
||||||
|
OPTION( USE_SHA1DC "Use SHA-1 with collision detection" OFF )
|
||||||
OPTION( USE_ICONV "Link with and use iconv library" OFF )
|
OPTION( USE_ICONV "Link with and use iconv library" OFF )
|
||||||
OPTION( USE_SSH "Link with libssh to enable SSH support" ON )
|
OPTION( USE_SSH "Link with libssh to enable SSH support" ON )
|
||||||
OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF )
|
OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF )
|
||||||
@ -292,13 +293,16 @@ ELSE ()
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Specify sha1 implementation
|
# Specify sha1 implementation
|
||||||
IF (WIN32 AND NOT MINGW AND NOT SHA1_TYPE STREQUAL "builtin")
|
IF (USE_SHA1DC)
|
||||||
ADD_DEFINITIONS(-DWIN32_SHA1)
|
ADD_DEFINITIONS(-DGIT_SHA1_COLLISIONDETECT)
|
||||||
|
FILE(GLOB SRC_SHA1 src/hash/hash_collisiondetect.c src/hash/sha1dc/*)
|
||||||
|
ELSEIF (WIN32 AND NOT MINGW)
|
||||||
|
ADD_DEFINITIONS(-DGIT_SHA1_WIN32)
|
||||||
FILE(GLOB SRC_SHA1 src/hash/hash_win32.c)
|
FILE(GLOB SRC_SHA1 src/hash/hash_win32.c)
|
||||||
ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
ADD_DEFINITIONS(-DGIT_COMMON_CRYPTO)
|
ADD_DEFINITIONS(-DGIT_SHA1_COMMON_CRYPTO)
|
||||||
ELSEIF (OPENSSL_FOUND AND NOT SHA1_TYPE STREQUAL "builtin")
|
ELSEIF (OPENSSL_FOUND)
|
||||||
ADD_DEFINITIONS(-DOPENSSL_SHA1)
|
ADD_DEFINITIONS(-DGIT_SHA1_OPENSSL)
|
||||||
IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||||
LIST(APPEND LIBGIT2_PC_LIBS "-lssl")
|
LIST(APPEND LIBGIT2_PC_LIBS "-lssl")
|
||||||
ELSE()
|
ELSE()
|
||||||
|
33
COPYING
33
COPYING
@ -958,3 +958,36 @@ necessary. Here is a sample; alter the names:
|
|||||||
That's all there is to it!
|
That's all there is to it!
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
The bundled SHA1 collision detection code is licensed under the MIT license:
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2017:
|
||||||
|
Marc Stevens
|
||||||
|
Cryptology Group
|
||||||
|
Centrum Wiskunde & Informatica
|
||||||
|
P.O. Box 94079, 1090 GB Amsterdam, Netherlands
|
||||||
|
marc@marc-stevens.nl
|
||||||
|
|
||||||
|
Dan Shumow
|
||||||
|
Microsoft Research
|
||||||
|
danshu@microsoft.com
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
@ -100,7 +100,8 @@ typedef enum {
|
|||||||
GITERR_REBASE,
|
GITERR_REBASE,
|
||||||
GITERR_FILESYSTEM,
|
GITERR_FILESYSTEM,
|
||||||
GITERR_PATCH,
|
GITERR_PATCH,
|
||||||
GITERR_WORKTREE
|
GITERR_WORKTREE,
|
||||||
|
GITERR_SHA1
|
||||||
} git_error_t;
|
} git_error_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,11 +16,13 @@ int git_hash_global_init(void);
|
|||||||
int git_hash_ctx_init(git_hash_ctx *ctx);
|
int git_hash_ctx_init(git_hash_ctx *ctx);
|
||||||
void git_hash_ctx_cleanup(git_hash_ctx *ctx);
|
void git_hash_ctx_cleanup(git_hash_ctx *ctx);
|
||||||
|
|
||||||
#if defined(GIT_COMMON_CRYPTO)
|
#if defined(GIT_SHA1_COLLISIONDETECT)
|
||||||
|
# include "hash/hash_collisiondetect.h"
|
||||||
|
#elif defined(GIT_SHA1_COMMON_CRYPTO)
|
||||||
# include "hash/hash_common_crypto.h"
|
# include "hash/hash_common_crypto.h"
|
||||||
#elif defined(OPENSSL_SHA1)
|
#elif defined(GIT_SHA1_OPENSSL)
|
||||||
# include "hash/hash_openssl.h"
|
# include "hash/hash_openssl.h"
|
||||||
#elif defined(WIN32_SHA1)
|
#elif defined(GIT_SHA1_WIN32)
|
||||||
# include "hash/hash_win32.h"
|
# include "hash/hash_win32.h"
|
||||||
#else
|
#else
|
||||||
# include "hash/hash_generic.h"
|
# include "hash/hash_generic.h"
|
||||||
|
57
src/hash/hash_collisiondetect.h
Normal file
57
src/hash/hash_collisiondetect.h
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) the libgit2 contributors. All rights reserved.
|
||||||
|
*
|
||||||
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
||||||
|
* a Linking Exception. For full terms see the included COPYING file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDE_hash_collisiondetect_h__
|
||||||
|
#define INCLUDE_hash_collisiondetect_h__
|
||||||
|
|
||||||
|
#include "hash.h"
|
||||||
|
#include "sha1dc/sha1.h"
|
||||||
|
|
||||||
|
struct git_hash_ctx {
|
||||||
|
SHA1_CTX c;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define git_hash_global_init() 0
|
||||||
|
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
|
||||||
|
#define git_hash_ctx_cleanup(ctx)
|
||||||
|
|
||||||
|
GIT_INLINE(int) git_hash_init(git_hash_ctx *ctx)
|
||||||
|
{
|
||||||
|
assert(ctx);
|
||||||
|
SHA1DCInit(&ctx->c);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GIT_INLINE(int) git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
|
||||||
|
{
|
||||||
|
const char *p = data;
|
||||||
|
|
||||||
|
assert(ctx);
|
||||||
|
|
||||||
|
/* We expect a size_t, but sha1dc only takes an int */
|
||||||
|
while (len > INT_MAX) {
|
||||||
|
SHA1DCUpdate(&ctx->c, p, INT_MAX);
|
||||||
|
p += INT_MAX;
|
||||||
|
len -= INT_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
SHA1DCUpdate(&ctx->c, p, len);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GIT_INLINE(int) git_hash_final(git_oid *out, git_hash_ctx *ctx)
|
||||||
|
{
|
||||||
|
assert(ctx);
|
||||||
|
if (SHA1DCFinal(out->id, &ctx->c)) {
|
||||||
|
giterr_set(GITERR_SHA1, "SHA1 collision attack detected");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* INCLUDE_hash_collisiondetect_h__ */
|
1149
src/hash/sha1dc/sha1.c
Normal file
1149
src/hash/sha1dc/sha1.c
Normal file
File diff suppressed because it is too large
Load Diff
94
src/hash/sha1dc/sha1.h
Normal file
94
src/hash/sha1dc/sha1.h
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
/***
|
||||||
|
* Copyright 2017 Marc Stevens <marc@marc-stevens.nl>, Dan Shumow <danshu@microsoft.com>
|
||||||
|
* Distributed under the MIT Software License.
|
||||||
|
* See accompanying file LICENSE.txt or copy at
|
||||||
|
* https://opensource.org/licenses/MIT
|
||||||
|
***/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
// uses SHA-1 message expansion to expand the first 16 words of W[] to 80 words
|
||||||
|
void sha1_message_expansion(uint32_t W[80]);
|
||||||
|
|
||||||
|
// sha-1 compression function; first version takes a message block pre-parsed as 16 32-bit integers, second version takes an already expanded message)
|
||||||
|
void sha1_compression(uint32_t ihv[5], const uint32_t m[16]);
|
||||||
|
void sha1_compression_W(uint32_t ihv[5], const uint32_t W[80]);
|
||||||
|
|
||||||
|
// same as sha1_compression_W, but additionally store intermediate states
|
||||||
|
// only stores states ii (the state between step ii-1 and step ii) when DOSTORESTATEii is defined in ubc_check.h
|
||||||
|
void sha1_compression_states(uint32_t ihv[5], const uint32_t W[80], uint32_t states[80][5]);
|
||||||
|
|
||||||
|
// function type for sha1_recompression_step_T (uint32_t ihvin[5], uint32_t ihvout[5], const uint32_t me2[80], const uint32_t state[5])
|
||||||
|
// where 0 <= T < 80
|
||||||
|
// me2 is an expanded message (the expansion of an original message block XOR'ed with a disturbance vector's message block difference)
|
||||||
|
// state is the internal state (a,b,c,d,e) before step T of the SHA-1 compression function while processing the original message block
|
||||||
|
// the function will return:
|
||||||
|
// ihvin: the reconstructed input chaining value
|
||||||
|
// ihvout: the reconstructed output chaining value
|
||||||
|
typedef void(*sha1_recompression_type)(uint32_t*, uint32_t*, const uint32_t*, const uint32_t*);
|
||||||
|
|
||||||
|
// table of sha1_recompression_step_0, ... , sha1_recompression_step_79
|
||||||
|
extern sha1_recompression_type sha1_recompression_step[80];
|
||||||
|
|
||||||
|
// a callback function type that can be set to be called when a collision block has been found:
|
||||||
|
// void collision_block_callback(uint64_t byteoffset, const uint32_t ihvin1[5], const uint32_t ihvin2[5], const uint32_t m1[80], const uint32_t m2[80])
|
||||||
|
typedef void(*collision_block_callback)(uint64_t, const uint32_t*, const uint32_t*, const uint32_t*, const uint32_t*);
|
||||||
|
|
||||||
|
// the SHA-1 context
|
||||||
|
typedef struct {
|
||||||
|
uint64_t total;
|
||||||
|
uint32_t ihv[5];
|
||||||
|
unsigned char buffer[64];
|
||||||
|
int bigendian;
|
||||||
|
int found_collision;
|
||||||
|
int safe_hash;
|
||||||
|
int detect_coll;
|
||||||
|
int ubc_check;
|
||||||
|
int reduced_round_coll;
|
||||||
|
collision_block_callback callback;
|
||||||
|
|
||||||
|
uint32_t ihv1[5];
|
||||||
|
uint32_t ihv2[5];
|
||||||
|
uint32_t m1[80];
|
||||||
|
uint32_t m2[80];
|
||||||
|
uint32_t states[80][5];
|
||||||
|
} SHA1_CTX;
|
||||||
|
|
||||||
|
// initialize SHA-1 context
|
||||||
|
void SHA1DCInit(SHA1_CTX*);
|
||||||
|
|
||||||
|
// function to enable safe SHA-1 hashing:
|
||||||
|
// collision attacks are thwarted by hashing a detected near-collision block 3 times
|
||||||
|
// think of it as extending SHA-1 from 80-steps to 240-steps for such blocks:
|
||||||
|
// the best collision attacks against SHA-1 have complexity about 2^60,
|
||||||
|
// thus for 240-steps an immediate lower-bound for the best cryptanalytic attacks would 2^180
|
||||||
|
// an attacker would be better off using a generic birthday search of complexity 2^80
|
||||||
|
//
|
||||||
|
// enabling safe SHA-1 hashing will result in the correct SHA-1 hash for messages where no collision attack was detected
|
||||||
|
// but it will result in a different SHA-1 hash for messages where a collision attack was detected
|
||||||
|
// this will automatically invalidate SHA-1 based digital signature forgeries
|
||||||
|
// enabled by default
|
||||||
|
void SHA1DCSetSafeHash(SHA1_CTX*, int);
|
||||||
|
|
||||||
|
// function to disable or enable the use of Unavoidable Bitconditions (provides a significant speed up)
|
||||||
|
// enabled by default
|
||||||
|
void SHA1DCSetUseUBC(SHA1_CTX*, int);
|
||||||
|
|
||||||
|
// function to disable or enable the use of Collision Detection
|
||||||
|
// enabled by default
|
||||||
|
void SHA1DCSetUseDetectColl(SHA1_CTX* ctx, int detect_coll);
|
||||||
|
|
||||||
|
// function to disable or enable the detection of reduced-round SHA-1 collisions
|
||||||
|
// disabled by default
|
||||||
|
void SHA1DCSetDetectReducedRoundCollision(SHA1_CTX*, int);
|
||||||
|
|
||||||
|
// function to set a callback function, pass NULL to disable
|
||||||
|
// by default no callback set
|
||||||
|
void SHA1DCSetCallback(SHA1_CTX*, collision_block_callback);
|
||||||
|
|
||||||
|
// update SHA-1 context with buffer contents
|
||||||
|
void SHA1DCUpdate(SHA1_CTX*, const char*, unsigned);
|
||||||
|
|
||||||
|
// obtain SHA-1 hash from SHA-1 context
|
||||||
|
// returns: 0 = no collision detected, otherwise = collision found => warn user for active attack
|
||||||
|
int SHA1DCFinal(unsigned char[20], SHA1_CTX*);
|
361
src/hash/sha1dc/ubc_check.c
Normal file
361
src/hash/sha1dc/ubc_check.c
Normal file
@ -0,0 +1,361 @@
|
|||||||
|
/***
|
||||||
|
* Copyright 2017 Marc Stevens <marc@marc-stevens.nl>, Dan Shumow <danshu@microsoft.com>
|
||||||
|
* Distributed under the MIT Software License.
|
||||||
|
* See accompanying file LICENSE.txt or copy at
|
||||||
|
* https://opensource.org/licenses/MIT
|
||||||
|
***/
|
||||||
|
|
||||||
|
// this file was generated by the 'parse_bitrel' program in the tools section
|
||||||
|
// using the data files from directory 'tools/data/3565'
|
||||||
|
//
|
||||||
|
// sha1_dvs contains a list of SHA-1 Disturbance Vectors (DV) to check
|
||||||
|
// dvType, dvK and dvB define the DV: I(K,B) or II(K,B) (see the paper)
|
||||||
|
// dm[80] is the expanded message block XOR-difference defined by the DV
|
||||||
|
// testt is the step to do the recompression from for collision detection
|
||||||
|
// maski and maskb define the bit to check for each DV in the dvmask returned by ubc_check
|
||||||
|
//
|
||||||
|
// ubc_check takes as input an expanded message block and verifies the unavoidable bitconditions for all listed DVs
|
||||||
|
// it returns a dvmask where each bit belonging to a DV is set if all unavoidable bitconditions for that DV have been met
|
||||||
|
// thus one needs to do the recompression check for each DV that has its bit set
|
||||||
|
//
|
||||||
|
// ubc_check is programmatically generated and the unavoidable bitconditions have been hardcoded
|
||||||
|
// a directly verifiable version named ubc_check_verify can be found in ubc_check_verify.c
|
||||||
|
// ubc_check has been verified against ubc_check_verify using the 'ubc_check_test' program in the tools section
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "ubc_check.h"
|
||||||
|
|
||||||
|
static const uint32_t DV_I_43_0_bit = (uint32_t)(1) << 0;
|
||||||
|
static const uint32_t DV_I_44_0_bit = (uint32_t)(1) << 1;
|
||||||
|
static const uint32_t DV_I_45_0_bit = (uint32_t)(1) << 2;
|
||||||
|
static const uint32_t DV_I_46_0_bit = (uint32_t)(1) << 3;
|
||||||
|
static const uint32_t DV_I_46_2_bit = (uint32_t)(1) << 4;
|
||||||
|
static const uint32_t DV_I_47_0_bit = (uint32_t)(1) << 5;
|
||||||
|
static const uint32_t DV_I_47_2_bit = (uint32_t)(1) << 6;
|
||||||
|
static const uint32_t DV_I_48_0_bit = (uint32_t)(1) << 7;
|
||||||
|
static const uint32_t DV_I_48_2_bit = (uint32_t)(1) << 8;
|
||||||
|
static const uint32_t DV_I_49_0_bit = (uint32_t)(1) << 9;
|
||||||
|
static const uint32_t DV_I_49_2_bit = (uint32_t)(1) << 10;
|
||||||
|
static const uint32_t DV_I_50_0_bit = (uint32_t)(1) << 11;
|
||||||
|
static const uint32_t DV_I_50_2_bit = (uint32_t)(1) << 12;
|
||||||
|
static const uint32_t DV_I_51_0_bit = (uint32_t)(1) << 13;
|
||||||
|
static const uint32_t DV_I_51_2_bit = (uint32_t)(1) << 14;
|
||||||
|
static const uint32_t DV_I_52_0_bit = (uint32_t)(1) << 15;
|
||||||
|
static const uint32_t DV_II_45_0_bit = (uint32_t)(1) << 16;
|
||||||
|
static const uint32_t DV_II_46_0_bit = (uint32_t)(1) << 17;
|
||||||
|
static const uint32_t DV_II_46_2_bit = (uint32_t)(1) << 18;
|
||||||
|
static const uint32_t DV_II_47_0_bit = (uint32_t)(1) << 19;
|
||||||
|
static const uint32_t DV_II_48_0_bit = (uint32_t)(1) << 20;
|
||||||
|
static const uint32_t DV_II_49_0_bit = (uint32_t)(1) << 21;
|
||||||
|
static const uint32_t DV_II_49_2_bit = (uint32_t)(1) << 22;
|
||||||
|
static const uint32_t DV_II_50_0_bit = (uint32_t)(1) << 23;
|
||||||
|
static const uint32_t DV_II_50_2_bit = (uint32_t)(1) << 24;
|
||||||
|
static const uint32_t DV_II_51_0_bit = (uint32_t)(1) << 25;
|
||||||
|
static const uint32_t DV_II_51_2_bit = (uint32_t)(1) << 26;
|
||||||
|
static const uint32_t DV_II_52_0_bit = (uint32_t)(1) << 27;
|
||||||
|
static const uint32_t DV_II_53_0_bit = (uint32_t)(1) << 28;
|
||||||
|
static const uint32_t DV_II_54_0_bit = (uint32_t)(1) << 29;
|
||||||
|
static const uint32_t DV_II_55_0_bit = (uint32_t)(1) << 30;
|
||||||
|
static const uint32_t DV_II_56_0_bit = (uint32_t)(1) << 31;
|
||||||
|
|
||||||
|
dv_info_t sha1_dvs[] =
|
||||||
|
{
|
||||||
|
{1,43,0,58,0,0, { 0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6,0x8000004c,0x00000803,0x80000161,0x80000599 } }
|
||||||
|
, {1,44,0,58,0,1, { 0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6,0x8000004c,0x00000803,0x80000161 } }
|
||||||
|
, {1,45,0,58,0,2, { 0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6,0x8000004c,0x00000803 } }
|
||||||
|
, {1,46,0,58,0,3, { 0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6,0x8000004c } }
|
||||||
|
, {1,46,2,58,0,4, { 0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060,0x00000590,0x00001020,0x0000039a,0x00000132 } }
|
||||||
|
, {1,47,0,58,0,5, { 0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408,0x800000e6 } }
|
||||||
|
, {1,47,2,58,0,6, { 0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060,0x00000590,0x00001020,0x0000039a } }
|
||||||
|
, {1,48,0,58,0,7, { 0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164,0x00000408 } }
|
||||||
|
, {1,48,2,58,0,8, { 0xe000002a,0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060,0x00000590,0x00001020 } }
|
||||||
|
, {1,49,0,58,0,9, { 0x18000000,0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018,0x00000164 } }
|
||||||
|
, {1,49,2,58,0,10, { 0x60000000,0xe000002a,0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060,0x00000590 } }
|
||||||
|
, {1,50,0,65,0,11, { 0x0800000c,0x18000000,0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202,0x00000018 } }
|
||||||
|
, {1,50,2,65,0,12, { 0x20000030,0x60000000,0xe000002a,0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a,0x00000060 } }
|
||||||
|
, {1,51,0,65,0,13, { 0xe8000000,0x0800000c,0x18000000,0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012,0x80000202 } }
|
||||||
|
, {1,51,2,65,0,14, { 0xa0000003,0x20000030,0x60000000,0xe000002a,0x20000043,0xb0000040,0xd0000053,0xd0000022,0x20000000,0x60000032,0x60000043,0x20000040,0xe0000042,0x60000002,0x80000001,0x00000020,0x00000003,0x40000052,0x40000040,0xe0000052,0xa0000000,0x80000040,0x20000001,0x20000060,0x80000001,0x40000042,0xc0000043,0x40000022,0x00000003,0x40000042,0xc0000043,0xc0000022,0x00000001,0x40000002,0xc0000043,0x40000062,0x80000001,0x40000042,0x40000042,0x40000002,0x00000002,0x00000040,0x80000002,0x80000000,0x80000002,0x80000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000000,0x00000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000101,0x00000009,0x00000012,0x00000202,0x0000001a,0x00000124,0x0000040c,0x00000026,0x0000004a,0x0000080a } }
|
||||||
|
, {1,52,0,65,0,15, { 0x04000010,0xe8000000,0x0800000c,0x18000000,0xb800000a,0xc8000010,0x2c000010,0xf4000014,0xb4000008,0x08000000,0x9800000c,0xd8000010,0x08000010,0xb8000010,0x98000000,0x60000000,0x00000008,0xc0000000,0x90000014,0x10000010,0xb8000014,0x28000000,0x20000010,0x48000000,0x08000018,0x60000000,0x90000010,0xf0000010,0x90000008,0xc0000000,0x90000010,0xf0000010,0xb0000008,0x40000000,0x90000000,0xf0000010,0x90000018,0x60000000,0x90000010,0x90000010,0x90000000,0x80000000,0x00000010,0xa0000000,0x20000000,0xa0000000,0x20000010,0x00000000,0x20000010,0x20000000,0x00000010,0x20000000,0x00000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000040,0x40000002,0x80000004,0x80000080,0x80000006,0x00000049,0x00000103,0x80000009,0x80000012 } }
|
||||||
|
, {2,45,0,58,0,16, { 0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d,0x8000041a,0x000002e4,0x80000054,0x00000967 } }
|
||||||
|
, {2,46,0,58,0,17, { 0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d,0x8000041a,0x000002e4,0x80000054 } }
|
||||||
|
, {2,46,2,58,0,18, { 0x90000070,0xb0000053,0x30000008,0x00000043,0xd0000072,0xb0000010,0xf0000062,0xc0000042,0x00000030,0xe0000042,0x20000060,0xe0000041,0x20000050,0xc0000041,0xe0000072,0xa0000003,0xc0000012,0x60000041,0xc0000032,0x20000001,0xc0000002,0xe0000042,0x60000042,0x80000002,0x00000000,0x00000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000001,0x00000060,0x80000003,0x40000002,0xc0000040,0xc0000002,0x80000000,0x80000000,0x80000002,0x00000040,0x00000002,0x80000000,0x80000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000105,0x00000089,0x00000016,0x0000020b,0x0000011b,0x0000012d,0x0000041e,0x00000224,0x00000050,0x0000092e,0x0000046c,0x000005b6,0x0000106a,0x00000b90,0x00000152 } }
|
||||||
|
, {2,47,0,58,0,19, { 0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d,0x8000041a,0x000002e4 } }
|
||||||
|
, {2,48,0,58,0,20, { 0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d,0x8000041a } }
|
||||||
|
, {2,49,0,58,0,21, { 0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b,0x8000016d } }
|
||||||
|
, {2,49,2,58,0,22, { 0xf0000010,0xf000006a,0x80000040,0x90000070,0xb0000053,0x30000008,0x00000043,0xd0000072,0xb0000010,0xf0000062,0xc0000042,0x00000030,0xe0000042,0x20000060,0xe0000041,0x20000050,0xc0000041,0xe0000072,0xa0000003,0xc0000012,0x60000041,0xc0000032,0x20000001,0xc0000002,0xe0000042,0x60000042,0x80000002,0x00000000,0x00000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000001,0x00000060,0x80000003,0x40000002,0xc0000040,0xc0000002,0x80000000,0x80000000,0x80000002,0x00000040,0x00000002,0x80000000,0x80000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000105,0x00000089,0x00000016,0x0000020b,0x0000011b,0x0000012d,0x0000041e,0x00000224,0x00000050,0x0000092e,0x0000046c,0x000005b6 } }
|
||||||
|
, {2,50,0,65,0,23, { 0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b,0x0000011b } }
|
||||||
|
, {2,50,2,65,0,24, { 0xd0000072,0xf0000010,0xf000006a,0x80000040,0x90000070,0xb0000053,0x30000008,0x00000043,0xd0000072,0xb0000010,0xf0000062,0xc0000042,0x00000030,0xe0000042,0x20000060,0xe0000041,0x20000050,0xc0000041,0xe0000072,0xa0000003,0xc0000012,0x60000041,0xc0000032,0x20000001,0xc0000002,0xe0000042,0x60000042,0x80000002,0x00000000,0x00000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000001,0x00000060,0x80000003,0x40000002,0xc0000040,0xc0000002,0x80000000,0x80000000,0x80000002,0x00000040,0x00000002,0x80000000,0x80000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000105,0x00000089,0x00000016,0x0000020b,0x0000011b,0x0000012d,0x0000041e,0x00000224,0x00000050,0x0000092e,0x0000046c } }
|
||||||
|
, {2,51,0,65,0,25, { 0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014,0x8000024b } }
|
||||||
|
, {2,51,2,65,0,26, { 0x00000043,0xd0000072,0xf0000010,0xf000006a,0x80000040,0x90000070,0xb0000053,0x30000008,0x00000043,0xd0000072,0xb0000010,0xf0000062,0xc0000042,0x00000030,0xe0000042,0x20000060,0xe0000041,0x20000050,0xc0000041,0xe0000072,0xa0000003,0xc0000012,0x60000041,0xc0000032,0x20000001,0xc0000002,0xe0000042,0x60000042,0x80000002,0x00000000,0x00000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000000,0x00000040,0x80000001,0x00000060,0x80000003,0x40000002,0xc0000040,0xc0000002,0x80000000,0x80000000,0x80000002,0x00000040,0x00000002,0x80000000,0x80000000,0x80000000,0x00000002,0x00000040,0x00000000,0x80000040,0x80000002,0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000004,0x00000080,0x00000004,0x00000009,0x00000105,0x00000089,0x00000016,0x0000020b,0x0000011b,0x0000012d,0x0000041e,0x00000224,0x00000050,0x0000092e } }
|
||||||
|
, {2,52,0,65,0,27, { 0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089,0x00000014 } }
|
||||||
|
, {2,53,0,65,0,28, { 0xcc000014,0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107,0x00000089 } }
|
||||||
|
, {2,54,0,65,0,29, { 0x0400001c,0xcc000014,0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b,0x80000107 } }
|
||||||
|
, {2,55,0,65,0,30, { 0x00000010,0x0400001c,0xcc000014,0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046,0x4000004b } }
|
||||||
|
, {2,56,0,65,0,31, { 0x2600001a,0x00000010,0x0400001c,0xcc000014,0x0c000002,0xc0000010,0xb400001c,0x3c000004,0xbc00001a,0x20000010,0x2400001c,0xec000014,0x0c000002,0xc0000010,0xb400001c,0x2c000004,0xbc000018,0xb0000010,0x0000000c,0xb8000010,0x08000018,0x78000010,0x08000014,0x70000010,0xb800001c,0xe8000000,0xb0000004,0x58000010,0xb000000c,0x48000000,0xb0000000,0xb8000010,0x98000010,0xa0000000,0x00000000,0x00000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0x20000000,0x00000010,0x60000000,0x00000018,0xe0000000,0x90000000,0x30000010,0xb0000000,0x20000000,0x20000000,0xa0000000,0x00000010,0x80000000,0x20000000,0x20000000,0x20000000,0x80000000,0x00000010,0x00000000,0x20000010,0xa0000000,0x00000000,0x20000000,0x20000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000020,0x00000001,0x40000002,0x40000041,0x40000022,0x80000005,0xc0000082,0xc0000046 } }
|
||||||
|
, {0,0,0,0,0,0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}
|
||||||
|
};
|
||||||
|
void ubc_check(const uint32_t W[80], uint32_t dvmask[1])
|
||||||
|
{
|
||||||
|
uint32_t mask = ~((uint32_t)(0));
|
||||||
|
mask &= (((((W[44]^W[45])>>29)&1)-1) | ~(DV_I_48_0_bit|DV_I_51_0_bit|DV_I_52_0_bit|DV_II_45_0_bit|DV_II_46_0_bit|DV_II_50_0_bit|DV_II_51_0_bit));
|
||||||
|
mask &= (((((W[49]^W[50])>>29)&1)-1) | ~(DV_I_46_0_bit|DV_II_45_0_bit|DV_II_50_0_bit|DV_II_51_0_bit|DV_II_55_0_bit|DV_II_56_0_bit));
|
||||||
|
mask &= (((((W[48]^W[49])>>29)&1)-1) | ~(DV_I_45_0_bit|DV_I_52_0_bit|DV_II_49_0_bit|DV_II_50_0_bit|DV_II_54_0_bit|DV_II_55_0_bit));
|
||||||
|
mask &= ((((W[47]^(W[50]>>25))&(1<<4))-(1<<4)) | ~(DV_I_47_0_bit|DV_I_49_0_bit|DV_I_51_0_bit|DV_II_45_0_bit|DV_II_51_0_bit|DV_II_56_0_bit));
|
||||||
|
mask &= (((((W[47]^W[48])>>29)&1)-1) | ~(DV_I_44_0_bit|DV_I_51_0_bit|DV_II_48_0_bit|DV_II_49_0_bit|DV_II_53_0_bit|DV_II_54_0_bit));
|
||||||
|
mask &= (((((W[46]>>4)^(W[49]>>29))&1)-1) | ~(DV_I_46_0_bit|DV_I_48_0_bit|DV_I_50_0_bit|DV_I_52_0_bit|DV_II_50_0_bit|DV_II_55_0_bit));
|
||||||
|
mask &= (((((W[46]^W[47])>>29)&1)-1) | ~(DV_I_43_0_bit|DV_I_50_0_bit|DV_II_47_0_bit|DV_II_48_0_bit|DV_II_52_0_bit|DV_II_53_0_bit));
|
||||||
|
mask &= (((((W[45]>>4)^(W[48]>>29))&1)-1) | ~(DV_I_45_0_bit|DV_I_47_0_bit|DV_I_49_0_bit|DV_I_51_0_bit|DV_II_49_0_bit|DV_II_54_0_bit));
|
||||||
|
mask &= (((((W[45]^W[46])>>29)&1)-1) | ~(DV_I_49_0_bit|DV_I_52_0_bit|DV_II_46_0_bit|DV_II_47_0_bit|DV_II_51_0_bit|DV_II_52_0_bit));
|
||||||
|
mask &= (((((W[44]>>4)^(W[47]>>29))&1)-1) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_I_48_0_bit|DV_I_50_0_bit|DV_II_48_0_bit|DV_II_53_0_bit));
|
||||||
|
mask &= (((((W[43]>>4)^(W[46]>>29))&1)-1) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_I_47_0_bit|DV_I_49_0_bit|DV_II_47_0_bit|DV_II_52_0_bit));
|
||||||
|
mask &= (((((W[43]^W[44])>>29)&1)-1) | ~(DV_I_47_0_bit|DV_I_50_0_bit|DV_I_51_0_bit|DV_II_45_0_bit|DV_II_49_0_bit|DV_II_50_0_bit));
|
||||||
|
mask &= (((((W[42]>>4)^(W[45]>>29))&1)-1) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_I_48_0_bit|DV_I_52_0_bit|DV_II_46_0_bit|DV_II_51_0_bit));
|
||||||
|
mask &= (((((W[41]>>4)^(W[44]>>29))&1)-1) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_I_47_0_bit|DV_I_51_0_bit|DV_II_45_0_bit|DV_II_50_0_bit));
|
||||||
|
mask &= (((((W[40]^W[41])>>29)&1)-1) | ~(DV_I_44_0_bit|DV_I_47_0_bit|DV_I_48_0_bit|DV_II_46_0_bit|DV_II_47_0_bit|DV_II_56_0_bit));
|
||||||
|
mask &= (((((W[54]^W[55])>>29)&1)-1) | ~(DV_I_51_0_bit|DV_II_47_0_bit|DV_II_50_0_bit|DV_II_55_0_bit|DV_II_56_0_bit));
|
||||||
|
mask &= (((((W[53]^W[54])>>29)&1)-1) | ~(DV_I_50_0_bit|DV_II_46_0_bit|DV_II_49_0_bit|DV_II_54_0_bit|DV_II_55_0_bit));
|
||||||
|
mask &= (((((W[52]^W[53])>>29)&1)-1) | ~(DV_I_49_0_bit|DV_II_45_0_bit|DV_II_48_0_bit|DV_II_53_0_bit|DV_II_54_0_bit));
|
||||||
|
mask &= ((((W[50]^(W[53]>>25))&(1<<4))-(1<<4)) | ~(DV_I_50_0_bit|DV_I_52_0_bit|DV_II_46_0_bit|DV_II_48_0_bit|DV_II_54_0_bit));
|
||||||
|
mask &= (((((W[50]^W[51])>>29)&1)-1) | ~(DV_I_47_0_bit|DV_II_46_0_bit|DV_II_51_0_bit|DV_II_52_0_bit|DV_II_56_0_bit));
|
||||||
|
mask &= ((((W[49]^(W[52]>>25))&(1<<4))-(1<<4)) | ~(DV_I_49_0_bit|DV_I_51_0_bit|DV_II_45_0_bit|DV_II_47_0_bit|DV_II_53_0_bit));
|
||||||
|
mask &= ((((W[48]^(W[51]>>25))&(1<<4))-(1<<4)) | ~(DV_I_48_0_bit|DV_I_50_0_bit|DV_I_52_0_bit|DV_II_46_0_bit|DV_II_52_0_bit));
|
||||||
|
mask &= (((((W[42]^W[43])>>29)&1)-1) | ~(DV_I_46_0_bit|DV_I_49_0_bit|DV_I_50_0_bit|DV_II_48_0_bit|DV_II_49_0_bit));
|
||||||
|
mask &= (((((W[41]^W[42])>>29)&1)-1) | ~(DV_I_45_0_bit|DV_I_48_0_bit|DV_I_49_0_bit|DV_II_47_0_bit|DV_II_48_0_bit));
|
||||||
|
mask &= (((((W[40]>>4)^(W[43]>>29))&1)-1) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_I_50_0_bit|DV_II_49_0_bit|DV_II_56_0_bit));
|
||||||
|
mask &= (((((W[39]>>4)^(W[42]>>29))&1)-1) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_I_49_0_bit|DV_II_48_0_bit|DV_II_55_0_bit));
|
||||||
|
if (mask & (DV_I_44_0_bit|DV_I_48_0_bit|DV_II_47_0_bit|DV_II_54_0_bit|DV_II_56_0_bit))
|
||||||
|
mask &= (((((W[38]>>4)^(W[41]>>29))&1)-1) | ~(DV_I_44_0_bit|DV_I_48_0_bit|DV_II_47_0_bit|DV_II_54_0_bit|DV_II_56_0_bit));
|
||||||
|
mask &= (((((W[37]>>4)^(W[40]>>29))&1)-1) | ~(DV_I_43_0_bit|DV_I_47_0_bit|DV_II_46_0_bit|DV_II_53_0_bit|DV_II_55_0_bit));
|
||||||
|
if (mask & (DV_I_52_0_bit|DV_II_48_0_bit|DV_II_51_0_bit|DV_II_56_0_bit))
|
||||||
|
mask &= (((((W[55]^W[56])>>29)&1)-1) | ~(DV_I_52_0_bit|DV_II_48_0_bit|DV_II_51_0_bit|DV_II_56_0_bit));
|
||||||
|
if (mask & (DV_I_52_0_bit|DV_II_48_0_bit|DV_II_50_0_bit|DV_II_56_0_bit))
|
||||||
|
mask &= ((((W[52]^(W[55]>>25))&(1<<4))-(1<<4)) | ~(DV_I_52_0_bit|DV_II_48_0_bit|DV_II_50_0_bit|DV_II_56_0_bit));
|
||||||
|
if (mask & (DV_I_51_0_bit|DV_II_47_0_bit|DV_II_49_0_bit|DV_II_55_0_bit))
|
||||||
|
mask &= ((((W[51]^(W[54]>>25))&(1<<4))-(1<<4)) | ~(DV_I_51_0_bit|DV_II_47_0_bit|DV_II_49_0_bit|DV_II_55_0_bit));
|
||||||
|
if (mask & (DV_I_48_0_bit|DV_II_47_0_bit|DV_II_52_0_bit|DV_II_53_0_bit))
|
||||||
|
mask &= (((((W[51]^W[52])>>29)&1)-1) | ~(DV_I_48_0_bit|DV_II_47_0_bit|DV_II_52_0_bit|DV_II_53_0_bit));
|
||||||
|
if (mask & (DV_I_46_0_bit|DV_I_49_0_bit|DV_II_45_0_bit|DV_II_48_0_bit))
|
||||||
|
mask &= (((((W[36]>>4)^(W[40]>>29))&1)-1) | ~(DV_I_46_0_bit|DV_I_49_0_bit|DV_II_45_0_bit|DV_II_48_0_bit));
|
||||||
|
if (mask & (DV_I_52_0_bit|DV_II_48_0_bit|DV_II_49_0_bit))
|
||||||
|
mask &= ((0-(((W[53]^W[56])>>29)&1)) | ~(DV_I_52_0_bit|DV_II_48_0_bit|DV_II_49_0_bit));
|
||||||
|
if (mask & (DV_I_50_0_bit|DV_II_46_0_bit|DV_II_47_0_bit))
|
||||||
|
mask &= ((0-(((W[51]^W[54])>>29)&1)) | ~(DV_I_50_0_bit|DV_II_46_0_bit|DV_II_47_0_bit));
|
||||||
|
if (mask & (DV_I_49_0_bit|DV_I_51_0_bit|DV_II_45_0_bit))
|
||||||
|
mask &= ((0-(((W[50]^W[52])>>29)&1)) | ~(DV_I_49_0_bit|DV_I_51_0_bit|DV_II_45_0_bit));
|
||||||
|
if (mask & (DV_I_48_0_bit|DV_I_50_0_bit|DV_I_52_0_bit))
|
||||||
|
mask &= ((0-(((W[49]^W[51])>>29)&1)) | ~(DV_I_48_0_bit|DV_I_50_0_bit|DV_I_52_0_bit));
|
||||||
|
if (mask & (DV_I_47_0_bit|DV_I_49_0_bit|DV_I_51_0_bit))
|
||||||
|
mask &= ((0-(((W[48]^W[50])>>29)&1)) | ~(DV_I_47_0_bit|DV_I_49_0_bit|DV_I_51_0_bit));
|
||||||
|
if (mask & (DV_I_46_0_bit|DV_I_48_0_bit|DV_I_50_0_bit))
|
||||||
|
mask &= ((0-(((W[47]^W[49])>>29)&1)) | ~(DV_I_46_0_bit|DV_I_48_0_bit|DV_I_50_0_bit));
|
||||||
|
if (mask & (DV_I_45_0_bit|DV_I_47_0_bit|DV_I_49_0_bit))
|
||||||
|
mask &= ((0-(((W[46]^W[48])>>29)&1)) | ~(DV_I_45_0_bit|DV_I_47_0_bit|DV_I_49_0_bit));
|
||||||
|
mask &= ((((W[45]^W[47])&(1<<6))-(1<<6)) | ~(DV_I_47_2_bit|DV_I_49_2_bit|DV_I_51_2_bit));
|
||||||
|
if (mask & (DV_I_44_0_bit|DV_I_46_0_bit|DV_I_48_0_bit))
|
||||||
|
mask &= ((0-(((W[45]^W[47])>>29)&1)) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_I_48_0_bit));
|
||||||
|
mask &= (((((W[44]^W[46])>>6)&1)-1) | ~(DV_I_46_2_bit|DV_I_48_2_bit|DV_I_50_2_bit));
|
||||||
|
if (mask & (DV_I_43_0_bit|DV_I_45_0_bit|DV_I_47_0_bit))
|
||||||
|
mask &= ((0-(((W[44]^W[46])>>29)&1)) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_I_47_0_bit));
|
||||||
|
mask &= ((0-((W[41]^(W[42]>>5))&(1<<1))) | ~(DV_I_48_2_bit|DV_II_46_2_bit|DV_II_51_2_bit));
|
||||||
|
mask &= ((0-((W[40]^(W[41]>>5))&(1<<1))) | ~(DV_I_47_2_bit|DV_I_51_2_bit|DV_II_50_2_bit));
|
||||||
|
if (mask & (DV_I_44_0_bit|DV_I_46_0_bit|DV_II_56_0_bit))
|
||||||
|
mask &= ((0-(((W[40]^W[42])>>4)&1)) | ~(DV_I_44_0_bit|DV_I_46_0_bit|DV_II_56_0_bit));
|
||||||
|
mask &= ((0-((W[39]^(W[40]>>5))&(1<<1))) | ~(DV_I_46_2_bit|DV_I_50_2_bit|DV_II_49_2_bit));
|
||||||
|
if (mask & (DV_I_43_0_bit|DV_I_45_0_bit|DV_II_55_0_bit))
|
||||||
|
mask &= ((0-(((W[39]^W[41])>>4)&1)) | ~(DV_I_43_0_bit|DV_I_45_0_bit|DV_II_55_0_bit));
|
||||||
|
if (mask & (DV_I_44_0_bit|DV_II_54_0_bit|DV_II_56_0_bit))
|
||||||
|
mask &= ((0-(((W[38]^W[40])>>4)&1)) | ~(DV_I_44_0_bit|DV_II_54_0_bit|DV_II_56_0_bit));
|
||||||
|
if (mask & (DV_I_43_0_bit|DV_II_53_0_bit|DV_II_55_0_bit))
|
||||||
|
mask &= ((0-(((W[37]^W[39])>>4)&1)) | ~(DV_I_43_0_bit|DV_II_53_0_bit|DV_II_55_0_bit));
|
||||||
|
mask &= ((0-((W[36]^(W[37]>>5))&(1<<1))) | ~(DV_I_47_2_bit|DV_I_50_2_bit|DV_II_46_2_bit));
|
||||||
|
if (mask & (DV_I_45_0_bit|DV_I_48_0_bit|DV_II_47_0_bit))
|
||||||
|
mask &= (((((W[35]>>4)^(W[39]>>29))&1)-1) | ~(DV_I_45_0_bit|DV_I_48_0_bit|DV_II_47_0_bit));
|
||||||
|
if (mask & (DV_I_48_0_bit|DV_II_48_0_bit))
|
||||||
|
mask &= ((0-((W[63]^(W[64]>>5))&(1<<0))) | ~(DV_I_48_0_bit|DV_II_48_0_bit));
|
||||||
|
if (mask & (DV_I_45_0_bit|DV_II_45_0_bit))
|
||||||
|
mask &= ((0-((W[63]^(W[64]>>5))&(1<<1))) | ~(DV_I_45_0_bit|DV_II_45_0_bit));
|
||||||
|
if (mask & (DV_I_47_0_bit|DV_II_47_0_bit))
|
||||||
|
mask &= ((0-((W[62]^(W[63]>>5))&(1<<0))) | ~(DV_I_47_0_bit|DV_II_47_0_bit));
|
||||||
|
if (mask & (DV_I_46_0_bit|DV_II_46_0_bit))
|
||||||
|
mask &= ((0-((W[61]^(W[62]>>5))&(1<<0))) | ~(DV_I_46_0_bit|DV_II_46_0_bit));
|
||||||
|
mask &= ((0-((W[61]^(W[62]>>5))&(1<<2))) | ~(DV_I_46_2_bit|DV_II_46_2_bit));
|
||||||
|
if (mask & (DV_I_45_0_bit|DV_II_45_0_bit))
|
||||||
|
mask &= ((0-((W[60]^(W[61]>>5))&(1<<0))) | ~(DV_I_45_0_bit|DV_II_45_0_bit));
|
||||||
|
if (mask & (DV_II_51_0_bit|DV_II_54_0_bit))
|
||||||
|
mask &= (((((W[58]^W[59])>>29)&1)-1) | ~(DV_II_51_0_bit|DV_II_54_0_bit));
|
||||||
|
if (mask & (DV_II_50_0_bit|DV_II_53_0_bit))
|
||||||
|
mask &= (((((W[57]^W[58])>>29)&1)-1) | ~(DV_II_50_0_bit|DV_II_53_0_bit));
|
||||||
|
if (mask & (DV_II_52_0_bit|DV_II_54_0_bit))
|
||||||
|
mask &= ((((W[56]^(W[59]>>25))&(1<<4))-(1<<4)) | ~(DV_II_52_0_bit|DV_II_54_0_bit));
|
||||||
|
if (mask & (DV_II_51_0_bit|DV_II_52_0_bit))
|
||||||
|
mask &= ((0-(((W[56]^W[59])>>29)&1)) | ~(DV_II_51_0_bit|DV_II_52_0_bit));
|
||||||
|
if (mask & (DV_II_49_0_bit|DV_II_52_0_bit))
|
||||||
|
mask &= (((((W[56]^W[57])>>29)&1)-1) | ~(DV_II_49_0_bit|DV_II_52_0_bit));
|
||||||
|
if (mask & (DV_II_51_0_bit|DV_II_53_0_bit))
|
||||||
|
mask &= ((((W[55]^(W[58]>>25))&(1<<4))-(1<<4)) | ~(DV_II_51_0_bit|DV_II_53_0_bit));
|
||||||
|
if (mask & (DV_II_50_0_bit|DV_II_52_0_bit))
|
||||||
|
mask &= ((((W[54]^(W[57]>>25))&(1<<4))-(1<<4)) | ~(DV_II_50_0_bit|DV_II_52_0_bit));
|
||||||
|
if (mask & (DV_II_49_0_bit|DV_II_51_0_bit))
|
||||||
|
mask &= ((((W[53]^(W[56]>>25))&(1<<4))-(1<<4)) | ~(DV_II_49_0_bit|DV_II_51_0_bit));
|
||||||
|
mask &= ((((W[51]^(W[50]>>5))&(1<<1))-(1<<1)) | ~(DV_I_50_2_bit|DV_II_46_2_bit));
|
||||||
|
mask &= ((((W[48]^W[50])&(1<<6))-(1<<6)) | ~(DV_I_50_2_bit|DV_II_46_2_bit));
|
||||||
|
if (mask & (DV_I_51_0_bit|DV_I_52_0_bit))
|
||||||
|
mask &= ((0-(((W[48]^W[55])>>29)&1)) | ~(DV_I_51_0_bit|DV_I_52_0_bit));
|
||||||
|
mask &= ((((W[47]^W[49])&(1<<6))-(1<<6)) | ~(DV_I_49_2_bit|DV_I_51_2_bit));
|
||||||
|
mask &= ((((W[48]^(W[47]>>5))&(1<<1))-(1<<1)) | ~(DV_I_47_2_bit|DV_II_51_2_bit));
|
||||||
|
mask &= ((((W[46]^W[48])&(1<<6))-(1<<6)) | ~(DV_I_48_2_bit|DV_I_50_2_bit));
|
||||||
|
mask &= ((((W[47]^(W[46]>>5))&(1<<1))-(1<<1)) | ~(DV_I_46_2_bit|DV_II_50_2_bit));
|
||||||
|
mask &= ((0-((W[44]^(W[45]>>5))&(1<<1))) | ~(DV_I_51_2_bit|DV_II_49_2_bit));
|
||||||
|
mask &= ((((W[43]^W[45])&(1<<6))-(1<<6)) | ~(DV_I_47_2_bit|DV_I_49_2_bit));
|
||||||
|
mask &= (((((W[42]^W[44])>>6)&1)-1) | ~(DV_I_46_2_bit|DV_I_48_2_bit));
|
||||||
|
mask &= ((((W[43]^(W[42]>>5))&(1<<1))-(1<<1)) | ~(DV_II_46_2_bit|DV_II_51_2_bit));
|
||||||
|
mask &= ((((W[42]^(W[41]>>5))&(1<<1))-(1<<1)) | ~(DV_I_51_2_bit|DV_II_50_2_bit));
|
||||||
|
mask &= ((((W[41]^(W[40]>>5))&(1<<1))-(1<<1)) | ~(DV_I_50_2_bit|DV_II_49_2_bit));
|
||||||
|
if (mask & (DV_I_52_0_bit|DV_II_51_0_bit))
|
||||||
|
mask &= ((((W[39]^(W[43]>>25))&(1<<4))-(1<<4)) | ~(DV_I_52_0_bit|DV_II_51_0_bit));
|
||||||
|
if (mask & (DV_I_51_0_bit|DV_II_50_0_bit))
|
||||||
|
mask &= ((((W[38]^(W[42]>>25))&(1<<4))-(1<<4)) | ~(DV_I_51_0_bit|DV_II_50_0_bit));
|
||||||
|
if (mask & (DV_I_48_2_bit|DV_I_51_2_bit))
|
||||||
|
mask &= ((0-((W[37]^(W[38]>>5))&(1<<1))) | ~(DV_I_48_2_bit|DV_I_51_2_bit));
|
||||||
|
if (mask & (DV_I_50_0_bit|DV_II_49_0_bit))
|
||||||
|
mask &= ((((W[37]^(W[41]>>25))&(1<<4))-(1<<4)) | ~(DV_I_50_0_bit|DV_II_49_0_bit));
|
||||||
|
if (mask & (DV_II_52_0_bit|DV_II_54_0_bit))
|
||||||
|
mask &= ((0-((W[36]^W[38])&(1<<4))) | ~(DV_II_52_0_bit|DV_II_54_0_bit));
|
||||||
|
mask &= ((0-((W[35]^(W[36]>>5))&(1<<1))) | ~(DV_I_46_2_bit|DV_I_49_2_bit));
|
||||||
|
if (mask & (DV_I_51_0_bit|DV_II_47_0_bit))
|
||||||
|
mask &= ((((W[35]^(W[39]>>25))&(1<<3))-(1<<3)) | ~(DV_I_51_0_bit|DV_II_47_0_bit));
|
||||||
|
if (mask) {
|
||||||
|
|
||||||
|
if (mask & DV_I_43_0_bit)
|
||||||
|
if (
|
||||||
|
!((W[61]^(W[62]>>5)) & (1<<1))
|
||||||
|
|| !(!((W[59]^(W[63]>>25)) & (1<<5)))
|
||||||
|
|| !((W[58]^(W[63]>>30)) & (1<<0))
|
||||||
|
) mask &= ~DV_I_43_0_bit;
|
||||||
|
if (mask & DV_I_44_0_bit)
|
||||||
|
if (
|
||||||
|
!((W[62]^(W[63]>>5)) & (1<<1))
|
||||||
|
|| !(!((W[60]^(W[64]>>25)) & (1<<5)))
|
||||||
|
|| !((W[59]^(W[64]>>30)) & (1<<0))
|
||||||
|
) mask &= ~DV_I_44_0_bit;
|
||||||
|
if (mask & DV_I_46_2_bit)
|
||||||
|
mask &= ((~((W[40]^W[42])>>2)) | ~DV_I_46_2_bit);
|
||||||
|
if (mask & DV_I_47_2_bit)
|
||||||
|
if (
|
||||||
|
!((W[62]^(W[63]>>5)) & (1<<2))
|
||||||
|
|| !(!((W[41]^W[43]) & (1<<6)))
|
||||||
|
) mask &= ~DV_I_47_2_bit;
|
||||||
|
if (mask & DV_I_48_2_bit)
|
||||||
|
if (
|
||||||
|
!((W[63]^(W[64]>>5)) & (1<<2))
|
||||||
|
|| !(!((W[48]^(W[49]<<5)) & (1<<6)))
|
||||||
|
) mask &= ~DV_I_48_2_bit;
|
||||||
|
if (mask & DV_I_49_2_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[49]^(W[50]<<5)) & (1<<6)))
|
||||||
|
|| !((W[42]^W[50]) & (1<<1))
|
||||||
|
|| !(!((W[39]^(W[40]<<5)) & (1<<6)))
|
||||||
|
|| !((W[38]^W[40]) & (1<<1))
|
||||||
|
) mask &= ~DV_I_49_2_bit;
|
||||||
|
if (mask & DV_I_50_0_bit)
|
||||||
|
mask &= ((((W[36]^W[37])<<7)) | ~DV_I_50_0_bit);
|
||||||
|
if (mask & DV_I_50_2_bit)
|
||||||
|
mask &= ((((W[43]^W[51])<<11)) | ~DV_I_50_2_bit);
|
||||||
|
if (mask & DV_I_51_0_bit)
|
||||||
|
mask &= ((((W[37]^W[38])<<9)) | ~DV_I_51_0_bit);
|
||||||
|
if (mask & DV_I_51_2_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[51]^(W[52]<<5)) & (1<<6)))
|
||||||
|
|| !(!((W[49]^W[51]) & (1<<6)))
|
||||||
|
|| !(!((W[37]^(W[37]>>5)) & (1<<1)))
|
||||||
|
|| !(!((W[35]^(W[39]>>25)) & (1<<5)))
|
||||||
|
) mask &= ~DV_I_51_2_bit;
|
||||||
|
if (mask & DV_I_52_0_bit)
|
||||||
|
mask &= ((((W[38]^W[39])<<11)) | ~DV_I_52_0_bit);
|
||||||
|
if (mask & DV_II_46_2_bit)
|
||||||
|
mask &= ((((W[47]^W[51])<<17)) | ~DV_II_46_2_bit);
|
||||||
|
if (mask & DV_II_48_0_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[36]^(W[40]>>25)) & (1<<3)))
|
||||||
|
|| !((W[35]^(W[40]<<2)) & (1<<30))
|
||||||
|
) mask &= ~DV_II_48_0_bit;
|
||||||
|
if (mask & DV_II_49_0_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[37]^(W[41]>>25)) & (1<<3)))
|
||||||
|
|| !((W[36]^(W[41]<<2)) & (1<<30))
|
||||||
|
) mask &= ~DV_II_49_0_bit;
|
||||||
|
if (mask & DV_II_49_2_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[53]^(W[54]<<5)) & (1<<6)))
|
||||||
|
|| !(!((W[51]^W[53]) & (1<<6)))
|
||||||
|
|| !((W[50]^W[54]) & (1<<1))
|
||||||
|
|| !(!((W[45]^(W[46]<<5)) & (1<<6)))
|
||||||
|
|| !(!((W[37]^(W[41]>>25)) & (1<<5)))
|
||||||
|
|| !((W[36]^(W[41]>>30)) & (1<<0))
|
||||||
|
) mask &= ~DV_II_49_2_bit;
|
||||||
|
if (mask & DV_II_50_0_bit)
|
||||||
|
if (
|
||||||
|
!((W[55]^W[58]) & (1<<29))
|
||||||
|
|| !(!((W[38]^(W[42]>>25)) & (1<<3)))
|
||||||
|
|| !((W[37]^(W[42]<<2)) & (1<<30))
|
||||||
|
) mask &= ~DV_II_50_0_bit;
|
||||||
|
if (mask & DV_II_50_2_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[54]^(W[55]<<5)) & (1<<6)))
|
||||||
|
|| !(!((W[52]^W[54]) & (1<<6)))
|
||||||
|
|| !((W[51]^W[55]) & (1<<1))
|
||||||
|
|| !((W[45]^W[47]) & (1<<1))
|
||||||
|
|| !(!((W[38]^(W[42]>>25)) & (1<<5)))
|
||||||
|
|| !((W[37]^(W[42]>>30)) & (1<<0))
|
||||||
|
) mask &= ~DV_II_50_2_bit;
|
||||||
|
if (mask & DV_II_51_0_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[39]^(W[43]>>25)) & (1<<3)))
|
||||||
|
|| !((W[38]^(W[43]<<2)) & (1<<30))
|
||||||
|
) mask &= ~DV_II_51_0_bit;
|
||||||
|
if (mask & DV_II_51_2_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[55]^(W[56]<<5)) & (1<<6)))
|
||||||
|
|| !(!((W[53]^W[55]) & (1<<6)))
|
||||||
|
|| !((W[52]^W[56]) & (1<<1))
|
||||||
|
|| !((W[46]^W[48]) & (1<<1))
|
||||||
|
|| !(!((W[39]^(W[43]>>25)) & (1<<5)))
|
||||||
|
|| !((W[38]^(W[43]>>30)) & (1<<0))
|
||||||
|
) mask &= ~DV_II_51_2_bit;
|
||||||
|
if (mask & DV_II_52_0_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[59]^W[60]) & (1<<29)))
|
||||||
|
|| !(!((W[40]^(W[44]>>25)) & (1<<3)))
|
||||||
|
|| !(!((W[40]^(W[44]>>25)) & (1<<4)))
|
||||||
|
|| !((W[39]^(W[44]<<2)) & (1<<30))
|
||||||
|
) mask &= ~DV_II_52_0_bit;
|
||||||
|
if (mask & DV_II_53_0_bit)
|
||||||
|
if (
|
||||||
|
!((W[58]^W[61]) & (1<<29))
|
||||||
|
|| !(!((W[57]^(W[61]>>25)) & (1<<4)))
|
||||||
|
|| !(!((W[41]^(W[45]>>25)) & (1<<3)))
|
||||||
|
|| !(!((W[41]^(W[45]>>25)) & (1<<4)))
|
||||||
|
) mask &= ~DV_II_53_0_bit;
|
||||||
|
if (mask & DV_II_54_0_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[58]^(W[62]>>25)) & (1<<4)))
|
||||||
|
|| !(!((W[42]^(W[46]>>25)) & (1<<3)))
|
||||||
|
|| !(!((W[42]^(W[46]>>25)) & (1<<4)))
|
||||||
|
) mask &= ~DV_II_54_0_bit;
|
||||||
|
if (mask & DV_II_55_0_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[59]^(W[63]>>25)) & (1<<4)))
|
||||||
|
|| !(!((W[57]^(W[59]>>25)) & (1<<4)))
|
||||||
|
|| !(!((W[43]^(W[47]>>25)) & (1<<3)))
|
||||||
|
|| !(!((W[43]^(W[47]>>25)) & (1<<4)))
|
||||||
|
) mask &= ~DV_II_55_0_bit;
|
||||||
|
if (mask & DV_II_56_0_bit)
|
||||||
|
if (
|
||||||
|
!(!((W[60]^(W[64]>>25)) & (1<<4)))
|
||||||
|
|| !(!((W[44]^(W[48]>>25)) & (1<<3)))
|
||||||
|
|| !(!((W[44]^(W[48]>>25)) & (1<<4)))
|
||||||
|
) mask &= ~DV_II_56_0_bit;
|
||||||
|
}
|
||||||
|
|
||||||
|
dvmask[0]=mask;
|
||||||
|
}
|
35
src/hash/sha1dc/ubc_check.h
Normal file
35
src/hash/sha1dc/ubc_check.h
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/***
|
||||||
|
* Copyright 2017 Marc Stevens <marc@marc-stevens.nl>, Dan Shumow <danshu@microsoft.com>
|
||||||
|
* Distributed under the MIT Software License.
|
||||||
|
* See accompanying file LICENSE.txt or copy at
|
||||||
|
* https://opensource.org/licenses/MIT
|
||||||
|
***/
|
||||||
|
|
||||||
|
// this file was generated by the 'parse_bitrel' program in the tools section
|
||||||
|
// using the data files from directory 'tools/data/3565'
|
||||||
|
//
|
||||||
|
// sha1_dvs contains a list of SHA-1 Disturbance Vectors (DV) to check
|
||||||
|
// dvType, dvK and dvB define the DV: I(K,B) or II(K,B) (see the paper)
|
||||||
|
// dm[80] is the expanded message block XOR-difference defined by the DV
|
||||||
|
// testt is the step to do the recompression from for collision detection
|
||||||
|
// maski and maskb define the bit to check for each DV in the dvmask returned by ubc_check
|
||||||
|
//
|
||||||
|
// ubc_check takes as input an expanded message block and verifies the unavoidable bitconditions for all listed DVs
|
||||||
|
// it returns a dvmask where each bit belonging to a DV is set if all unavoidable bitconditions for that DV have been met
|
||||||
|
// thus one needs to do the recompression check for each DV that has its bit set
|
||||||
|
|
||||||
|
#ifndef UBC_CHECK_H
|
||||||
|
#define UBC_CHECK_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define DVMASKSIZE 1
|
||||||
|
typedef struct { int dvType; int dvK; int dvB; int testt; int maski; int maskb; uint32_t dm[80]; } dv_info_t;
|
||||||
|
extern dv_info_t sha1_dvs[];
|
||||||
|
void ubc_check(const uint32_t W[80], uint32_t dvmask[DVMASKSIZE]);
|
||||||
|
|
||||||
|
#define DOSTORESTATE58
|
||||||
|
#define DOSTORESTATE65
|
||||||
|
|
||||||
|
|
||||||
|
#endif // UBC_CHECK_H
|
64
tests/core/sha1.c
Normal file
64
tests/core/sha1.c
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#include "clar_libgit2.h"
|
||||||
|
#include "hash.h"
|
||||||
|
|
||||||
|
#define FIXTURE_DIR "sha1"
|
||||||
|
|
||||||
|
void test_core_sha1__initialize(void)
|
||||||
|
{
|
||||||
|
cl_fixture_sandbox(FIXTURE_DIR);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_core_sha1__cleanup(void)
|
||||||
|
{
|
||||||
|
cl_fixture_cleanup(FIXTURE_DIR);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int sha1_file(git_oid *oid, const char *filename)
|
||||||
|
{
|
||||||
|
git_hash_ctx ctx;
|
||||||
|
char buf[2048];
|
||||||
|
int fd, ret;
|
||||||
|
ssize_t read_len;
|
||||||
|
|
||||||
|
fd = p_open(filename, O_RDONLY);
|
||||||
|
cl_assert(fd >= 0);
|
||||||
|
|
||||||
|
cl_git_pass(git_hash_ctx_init(&ctx));
|
||||||
|
|
||||||
|
while ((read_len = p_read(fd, buf, 2048)) > 0)
|
||||||
|
cl_git_pass(git_hash_update(&ctx, buf, (size_t)read_len));
|
||||||
|
|
||||||
|
cl_assert_equal_i(0, read_len);
|
||||||
|
p_close(fd);
|
||||||
|
|
||||||
|
ret = git_hash_final(oid, &ctx);
|
||||||
|
git_hash_ctx_cleanup(&ctx);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_core_sha1__sum(void)
|
||||||
|
{
|
||||||
|
git_oid oid, expected;
|
||||||
|
|
||||||
|
cl_git_pass(sha1_file(&oid, FIXTURE_DIR "/hello_c"));
|
||||||
|
git_oid_fromstr(&expected, "4e72679e3ea4d04e0c642f029e61eb8056c7ed94");
|
||||||
|
cl_assert_equal_oid(&expected, &oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* test that sha1 collision detection works when enabled */
|
||||||
|
void test_core_sha1__detect_collision_attack(void)
|
||||||
|
{
|
||||||
|
git_oid oid, expected;
|
||||||
|
|
||||||
|
#ifdef GIT_SHA1_COLLISIONDETECT
|
||||||
|
GIT_UNUSED(expected);
|
||||||
|
cl_git_fail(sha1_file(&oid, FIXTURE_DIR "/shattered-1.pdf"));
|
||||||
|
cl_assert_equal_s("SHA1 collision attack detected", giterr_last()->message);
|
||||||
|
#else
|
||||||
|
cl_git_pass(sha1_file(&oid, FIXTURE_DIR "/shattered-1.pdf"));
|
||||||
|
git_oid_fromstr(&expected, "38762cf7f55934b34d179ae6a4c80cadccbb7f0a");
|
||||||
|
cl_assert_equal_oid(&expected, &oid);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
BIN
tests/resources/sha1/hello_c
Normal file
BIN
tests/resources/sha1/hello_c
Normal file
Binary file not shown.
BIN
tests/resources/sha1/shattered-1.pdf
Normal file
BIN
tests/resources/sha1/shattered-1.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user