Blame src/hash/sha1dc/ubc_check.h

Packit Service 20376f
/***
Packit Service 20376f
* Copyright 2017 Marc Stevens <marc@marc-stevens.nl>, Dan Shumow <danshu@microsoft.com>
Packit Service 20376f
* Distributed under the MIT Software License.
Packit Service 20376f
* See accompanying file LICENSE.txt or copy at
Packit Service 20376f
* https://opensource.org/licenses/MIT
Packit Service 20376f
***/
Packit Service 20376f
Packit Service 20376f
/*
Packit Service 20376f
// this file was generated by the 'parse_bitrel' program in the tools section
Packit Service 20376f
// using the data files from directory 'tools/data/3565'
Packit Service 20376f
//
Packit Service 20376f
// sha1_dvs contains a list of SHA-1 Disturbance Vectors (DV) to check
Packit Service 20376f
// dvType, dvK and dvB define the DV: I(K,B) or II(K,B) (see the paper)
Packit Service 20376f
// dm[80] is the expanded message block XOR-difference defined by the DV
Packit Service 20376f
// testt is the step to do the recompression from for collision detection
Packit Service 20376f
// maski and maskb define the bit to check for each DV in the dvmask returned by ubc_check
Packit Service 20376f
//
Packit Service 20376f
// ubc_check takes as input an expanded message block and verifies the unavoidable bitconditions for all listed DVs
Packit Service 20376f
// it returns a dvmask where each bit belonging to a DV is set if all unavoidable bitconditions for that DV have been met
Packit Service 20376f
// thus one needs to do the recompression check for each DV that has its bit set
Packit Service 20376f
*/
Packit Service 20376f
Packit Service 20376f
#ifndef SHA1DC_UBC_CHECK_H
Packit Service 20376f
#define SHA1DC_UBC_CHECK_H
Packit Service 20376f
Packit Service 20376f
#if defined(__cplusplus)
Packit Service 20376f
extern "C" {
Packit Service 20376f
#endif
Packit Service 20376f
Packit Service 20376f
#ifndef SHA1DC_NO_STANDARD_INCLUDES
Packit Service 20376f
#include <stdint.h>
Packit Service 20376f
#endif
Packit Service 20376f
Packit Service 20376f
#define DVMASKSIZE 1
Packit Service 20376f
typedef struct { int dvType; int dvK; int dvB; int testt; int maski; int maskb; uint32_t dm[80]; } dv_info_t;
Packit Service 20376f
extern dv_info_t sha1_dvs[];
Packit Service 20376f
void ubc_check(const uint32_t W[80], uint32_t dvmask[DVMASKSIZE]);
Packit Service 20376f
Packit Service 20376f
#define DOSTORESTATE58
Packit Service 20376f
#define DOSTORESTATE65
Packit Service 20376f
Packit Service 20376f
#define CHECK_DVMASK(_DVMASK) (0 != _DVMASK[0])
Packit Service 20376f
Packit Service 20376f
#if defined(__cplusplus)
Packit Service 20376f
}
Packit Service 20376f
#endif
Packit Service 20376f
Packit Service 20376f
#ifdef SHA1DC_CUSTOM_TRAILING_INCLUDE_UBC_CHECK_H
Packit Service 20376f
#include SHA1DC_CUSTOM_TRAILING_INCLUDE_UBC_CHECK_H
Packit Service 20376f
#endif
Packit Service 20376f
Packit Service 20376f
#endif