]> git.proxmox.com Git - libgit2.git/blame - src/hash/sha1/sha1dc/ubc_check.h
New upstream version 1.4.3+dfsg.1
[libgit2.git] / src / hash / sha1 / sha1dc / ubc_check.h
CommitLineData
2dfd1294
ET
1/***
2* Copyright 2017 Marc Stevens <marc@marc-stevens.nl>, Dan Shumow <danshu@microsoft.com>
3* Distributed under the MIT Software License.
4* See accompanying file LICENSE.txt or copy at
5* https://opensource.org/licenses/MIT
6***/
7
c9efa995 8/*
2dfd1294
ET
9// this file was generated by the 'parse_bitrel' program in the tools section
10// using the data files from directory 'tools/data/3565'
11//
12// sha1_dvs contains a list of SHA-1 Disturbance Vectors (DV) to check
13// dvType, dvK and dvB define the DV: I(K,B) or II(K,B) (see the paper)
14// dm[80] is the expanded message block XOR-difference defined by the DV
15// testt is the step to do the recompression from for collision detection
16// maski and maskb define the bit to check for each DV in the dvmask returned by ubc_check
17//
18// ubc_check takes as input an expanded message block and verifies the unavoidable bitconditions for all listed DVs
19// it returns a dvmask where each bit belonging to a DV is set if all unavoidable bitconditions for that DV have been met
20// thus one needs to do the recompression check for each DV that has its bit set
c9efa995 21*/
2dfd1294 22
63d86c27
PS
23#ifndef SHA1DC_UBC_CHECK_H
24#define SHA1DC_UBC_CHECK_H
2dfd1294 25
c9efa995
ET
26#if defined(__cplusplus)
27extern "C" {
28#endif
29
63d86c27 30#ifndef SHA1DC_NO_STANDARD_INCLUDES
2dfd1294 31#include <stdint.h>
63d86c27 32#endif
2dfd1294
ET
33
34#define DVMASKSIZE 1
35typedef struct { int dvType; int dvK; int dvB; int testt; int maski; int maskb; uint32_t dm[80]; } dv_info_t;
36extern dv_info_t sha1_dvs[];
37void ubc_check(const uint32_t W[80], uint32_t dvmask[DVMASKSIZE]);
38
39#define DOSTORESTATE58
40#define DOSTORESTATE65
41
c9efa995
ET
42#define CHECK_DVMASK(_DVMASK) (0 != _DVMASK[0])
43
44#if defined(__cplusplus)
45}
46#endif
2dfd1294 47
63d86c27
PS
48#ifdef SHA1DC_CUSTOM_TRAILING_INCLUDE_UBC_CHECK_H
49#include SHA1DC_CUSTOM_TRAILING_INCLUDE_UBC_CHECK_H
50#endif
51
52#endif