First draft of Symcrypt build system on Git

This commit is contained in:
Niels Ferguson 2018-11-16 16:28:12 -08:00
Родитель 2b0d4561b6
Коммит f020f6aa44
189 изменённых файлов: 100899 добавлений и 0 удалений

7
dirs Normal file
Просмотреть файл

@ -0,0 +1,7 @@
DIRS = \
lib \
unittest \
gen{amd64} \

612
gen/main_gen.cpp Normal file
Просмотреть файл

@ -0,0 +1,612 @@
/*
SymCrypt main_gen.cpp
Program to generate the various constants & tables for the SymCrypt code
Copyright (c) Microsoft Corp, all rights reserved
*/
#include <ntstatus.h>
#pragma prefast(push)
#pragma prefast(disable: 26071, "Avoid error in validation of RtlULongLongMult")
#include <ntintsafe.h>
#pragma prefast(pop)
// Ensure that windows.h doesn't re-define the status_* symbols
#define WIN32_NO_STATUS
#include <windows.h>
#include <winternl.h>
#include <winioctl.h>
//
// Hack to get all the BCrypt declations even though our binaries target down-level platforms.
//
#pragma push_macro("NTDDI_VERSION")
#undef NTDDI_VERSION
#define NTDDI_VERSION NTDDI_WINTHRESHOLD
#include <bcrypt.h>
#pragma pop_macro("NTDDI_VERSION")
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <powrprof.h>
#include <vector>
#include <string>
#include <memory>
#include <algorithm>
#include <map>
#include <strstream>
#include <set>
#include <strsafe.h>
#include "symcrypt.h"
#define MAX_PRIMES 100000
_Analysis_noreturn_
VOID
fatal( _In_ PSTR file, ULONG line, _In_ PSTR format, ... )
{
va_list vl;
fprintf( stdout, "*\n\n***** FATAL ERROR %s(%d): ", file, line );
va_start( vl, format );
vfprintf( stdout, format, vl );
exit( -1 );
}
#define FATAL( text ) {fatal( __FILE__, __LINE__, text );}
#define FATAL2( text, a ) {fatal( __FILE__, __LINE__, text, a );}
#define FATAL3( text, a, b ) {fatal( __FILE__, __LINE__, text, a, b );}
#define FATAL4( text, a, b, c ) {fatal( __FILE__, __LINE__, text, a, b, c );}
#define FATAL5( text, a, b, c, d ) {fatal( __FILE__, __LINE__, text, a, b, c, d );}
#define FATAL6( text, a, b, c, d, e ) {fatal( __FILE__, __LINE__, text, a, b, c, d, e );}
#define CHECK( cond, text ) { if( !(cond) ) { fatal(__FILE__, __LINE__, text );}; _Analysis_assume_( cond );}
#define CHECK3( cond, text, a ) { if( !(cond) ) { fatal(__FILE__, __LINE__, text, a );}; _Analysis_assume_( cond );}
#define CHECK4( cond, text, a, b ) { if( !(cond) ) { fatal(__FILE__, __LINE__, text, a, b );}; _Analysis_assume_( cond );}
#define CHECK5( cond, text, a, b, c ) { if( !(cond) ) { fatal(__FILE__, __LINE__, text, a, b, c );}; _Analysis_assume_( cond );}
UINT32 g_smallPrimes[MAX_PRIMES];
UINT32 g_nSmallPrimes;
UINT32 g_nGroups;
VOID
generateSmallPrimes()
{
g_smallPrimes[0] = 2;
g_smallPrimes[1] = 3;
UINT32 nPrimes = 2;
UINT32 n = 3;
while( nPrimes < MAX_PRIMES )
{
n += 2; // next candidate
for( UINT32 i=1; i<=nPrimes; i++ )
{
UINT32 p = g_smallPrimes[i];
if( p*p > n )
{
// found a prime!
g_smallPrimes[nPrimes++] = n;
break;
}
if( n % p == 0 )
{
// found a composite
break;
}
}
}
}
VOID
printSmallPrimes( FILE * f, UINT32 primeLimit )
{
fprintf( f, "//\n" );
fprintf( f, "// Table of small primes <= %d\n", primeLimit );
fprintf( f, "// Copyright (c) Microsoft corp, all rights reserved\n" );
fprintf( f, "//\n" );
fprintf( f, "\n" );
fprintf( f, "const %s g_smallPrimes[] = {", primeLimit <= 65535 ? "UINT16" : "UINT32" );
UINT32 i = 0;
while( i < MAX_PRIMES && g_smallPrimes[i] <= primeLimit )
{
if( (i%8) == 0 ) {
fprintf( f, "\n " );
} else {
fprintf( f, " " );
}
fprintf( f, "%6d,", g_smallPrimes[i] );
i++;
}
CHECK( i < MAX_PRIMES, "Not enough primes generated" );
g_nSmallPrimes = i;
fprintf( f, "\n}; // There are %d primes <= %d\n", i, primeLimit );
}
VOID
printFileHeader( FILE * f )
{
fprintf( f,
"//\n"
"// Parameters for trial division mechanism\n"
"// Copyright (c) Microsoft corp, all rights reserved\n"
"// GENERATED FILE, DO NOT EDIT.\n"
"//\n"
"\n" );
}
VOID
printSmallPrimeDifferences( FILE * f, UINT32 primeLimit )
{
fprintf( f,
"//\n"
"// Table of small primes differences for primes <= %d\n"
"// Copyright (c) Microsoft corp, all rights reserved\n"
"// GENERATED FILE, DO NOT EDIT.\n"
"//\n"
"// Table encodes small primes except 2, 3, 5, and 17 which are handled separately\n"
"// Read the bytes in order, and split each byte into nibbles LSnibble first.\n"
"// Set p = 3 and for each nibble:\n"
"// if nibble != 0, next prime is p + 2*nibble\n"
"// if nibble == 0, set p = p + 30 and goto next nibble, no prime is specified\n"
"// if p == SYMCRYPT_MAX_SMALL_PRIME you've read the last nibble in the table\n"
"// SYMCYRPT_N_SMALL_PRIMES_ENCODED is the # primes encoded in the table\n"
"//\n"
"\n",
primeLimit );
fprintf( f, "const BYTE g_SymCryptSmallPrimeDifferenceNibbles[] = {" );
UINT32 prev;
UINT32 i;
UINT32 nCache = 0;
UINT32 nNibbles = 0;
char * sep = NULL;
UINT32 nib;
UINT32 diff;
UINT32 nBytes = 0;
UINT32 nPrimes = 0;
double filterRate = 1.0;
prev = 3;
i = 0;
while( i < MAX_PRIMES && g_smallPrimes[i] <= primeLimit )
{
UINT32 p = g_smallPrimes[i];
i++;
filterRate *= (double) (p-1) / p;
if( p == 2 || p == 3 || p == 5 || p == 17 )
{
// We ignore primes 2, 3, 5, and 17 in this encoding
continue;
}
diff = p - prev;
prev = p;
nPrimes++;
while( diff > 0 )
{
if( diff >= 32 )
{
nib = 0; diff -= 30;
} else {
nib = diff/2;
diff = 0;
}
if( (nNibbles & 1) == 0 )
{
nCache = nib;
} else {
sep = ((nNibbles % 32) == 1) ? "\n " : " ";
fprintf( f, "%s0x%02x,", sep, (nib << 4) | nCache );
nBytes++;
}
nNibbles++;
}
}
if( (nNibbles & 1 ) != 0 )
{
sep = ((nNibbles % 32) == 1) ? "\n " : " ";
fprintf( f, "%s0x%x,", sep, nCache );
nBytes++;
}
fprintf( f,
"\n"
"}; // encodes %d primes <= %d in %d bytes\n", nPrimes, primeLimit, nBytes );
fprintf( f,
"// Trial division (including 2,3,5,17) will pass %2.3f%% of inputs.\n", filterRate * 100 );
fprintf( f,
"\n"
"#define SYMCRYPT_MAX_SMALL_PRIME (%d)\n"
, prev );
fprintf( f,
"\n"
"#define SYMCRYPT_N_SMALL_PRIMES_ENCODED (%d)\n"
, nPrimes );
}
VOID
printPrimeGroupSpec( FILE *f, UINT64 productLimit )
{
fprintf( f,
"\n"
"//\n"
"// The primes are put into groups of consecutive primes (skipping 2, 3, 5, and 17).\n"
"// Each group has a product less than SYMCRYPT_MAX_SMALL_PRIME_GROUP_PRODUCT which is\n"
"// chosen to avoid overflows in the modular reduction computation.\n"
"//\n"
"\n"
"typedef struct _SYMCRYPT_SMALL_PRIME_GROUPS_SPEC {\n"
" UINT16 nGroups; // # groups of this size \n"
" UINT8 nPrimes; // # primes in the group \n"
" UINT32 maxPrime; // largest prime in the last group \n"
"} SYMCRYPT_SMALL_PRIME_GROUPS_SPEC;\n"
"\n"
);
fprintf( f, "#define SYMCRYPT_MAX_SMALL_PRIME_GROUP_PRODUCT (0x%I64xU)\n\n", productLimit );
fprintf( f, "const SYMCRYPT_SMALL_PRIME_GROUPS_SPEC g_SymCryptSmallPrimeGroupsSpec[] = {\n" );
UINT32 nPrevGroups = 0;
UINT32 nPrevPrimes = 1000;
UINT32 prevMaxPrime = 0;
UINT64 m = 1;
UINT32 nPrimesInThisGroup = 0;
UINT32 maxPrime = 0;
UINT32 i = 1;
UINT32 nGroups = 0;
UINT32 p = 0;
while( i < MAX_PRIMES && nPrevPrimes >= 2 )
{
p = g_smallPrimes[i];
i++;
if( p == 2 || p == 3 || p == 5 || p == 17 )
{
// We ignore primes 2, 3, 5, and 17 as they are handles differently
continue;
}
if( m <= productLimit / p )
{
//fprintf( f, "[%d]", p );
m *= p;
nPrimesInThisGroup++;
continue;
}
// We have found a group
//printf( "/" );
maxPrime = g_smallPrimes[i-2]; // largest prime of the group we just found
nGroups++;
if( nPrimesInThisGroup != nPrevPrimes )
{
if( prevMaxPrime != 0 )
{
fprintf( f, " { %5d, %2d, %d },\n", nPrevGroups, nPrevPrimes, prevMaxPrime );
}
nPrevGroups = 1;
nPrevPrimes = nPrimesInThisGroup;
prevMaxPrime = maxPrime;
if( nPrimesInThisGroup == 2 && productLimit > 0xffffffff )
{
break;
}
} else {
nPrevGroups++;
prevMaxPrime = maxPrime;
}
//fprintf( f, "[%d]", p );
m = p;
nPrimesInThisGroup = 1;
}
// We still have to process the last group
nGroups++;
if( nPrimesInThisGroup != nPrevPrimes )
{
if( nPrevPrimes != 0 )
{
fprintf( f, " { %5d, %2d, %d },\n", nPrevGroups, nPrevPrimes, prevMaxPrime );
}
nPrevGroups = 1;
nPrevPrimes = nPrimesInThisGroup;
prevMaxPrime = p;
} else {
nPrevGroups++;
}
fprintf( f, " { %5d, %2d, 0x%x },\n", 0, nPrimesInThisGroup, 0xffffffff );
fprintf( f, "};\n" );
fprintf( f, "\n" );
}
VOID
createFile( UINT32 bitSize /*, UINT32 primeLimit */)
{
CHECK( bitSize == 32 || bitSize == 64, "?" );
char * fileName = bitSize == 32 ? "smallPrimes32.h_gen" : "smallPrimes64.h_gen";
FILE * f = fopen( fileName, "wt" );
CHECK3( f != NULL, "Could not create file %s", fileName );
printFileHeader( f );
printFileHeader( stdout );
// dcl - cleanup?
//printSmallPrimeDifferences( f, primeLimit );
//printSmallPrimeDifferences( stdout, primeLimit );
// dcl - on 64-bit, productLimit should initialize to 0x8000000000000000
// Then when we multiply by 2, it becomes zero, and then very large
// Not sure if that's really what you intended.
UINT64 productLimit = (UINT64)1 << (bitSize-1); // Can't shift by 64...
productLimit *= 2;
productLimit -= 1;
productLimit /= 9;
printPrimeGroupSpec( f, productLimit );
printPrimeGroupSpec( stdout, productLimit );
fclose( f );
}
typedef struct {
UINT32 prime;
UINT32 selectivity; // 1/selectivity items pass this filter
double signalPerByte; // # bits of signal per byte of table space
} IFX_TPM_WEAK_KEY_PRIME_INFO;
int compareIfxPrimeSelectivity( const void * a, const void * b )
{
IFX_TPM_WEAK_KEY_PRIME_INFO *pA = (IFX_TPM_WEAK_KEY_PRIME_INFO *)a;
IFX_TPM_WEAK_KEY_PRIME_INFO *pB = (IFX_TPM_WEAK_KEY_PRIME_INFO *)b;
if( pA->selectivity < pB->selectivity ) return 1;
if( pA->selectivity == pB->selectivity ) return (int)(pA->prime) - (int)(pB->prime);
if( pA->selectivity > pB->selectivity ) return -1;
CHECK( FALSE, "?" );
return 0;
}
int compareIfxPrimeEfficiency( const void * a, const void * b )
{
IFX_TPM_WEAK_KEY_PRIME_INFO *pA = (IFX_TPM_WEAK_KEY_PRIME_INFO *)a;
IFX_TPM_WEAK_KEY_PRIME_INFO *pB = (IFX_TPM_WEAK_KEY_PRIME_INFO *)b;
// Compare identical if within 0.1% of each other
if( abs( pA->signalPerByte / pB->signalPerByte - 1.0 ) < 0.0001 ) return 0;
if( pA->signalPerByte < pB -> signalPerByte ) return 1;
return -1;
}
#define IFX_N_PRIMES_IN_KEYGEN (126)
VOID
buildGeneratorBitmap( UINT32 prime, UINT32 generator, BYTE * buf, UINT32 * pCnt )
{
UINT32 nBytes = (prime + 7) / 8;
memset( buf, 0, nBytes );
UINT32 s = 1;
UINT32 cnt = 0;
while( ( (buf[s/8] >> (s % 8)) & 1 ) == 0 )
{
buf[s/8] |= 1 << (s%8);
cnt++;
s = (s * generator) % prime;
}
*pCnt = cnt;
}
BYTE workBuffer[ 1<<20 ];
VOID
printIfxTpmWeakKeyTable( FILE * f )
{
fprintf( f,
"//\n"
"// Some Infineon TPMs generate(d) RSA keys where the primes and modulus, when taken\n"
"// modulo any of the first 126 primes, is a power of 65537\n"
"// These keys are insecure.\n"
"// This file contains information used to detect the modulus of these weak keys.\n"
"// Copyright (c) Microsoft corp, all rights reserved\n"
"// GENERATED FILE, DO NOT EDIT.\n"
"//\n"
"\n"
"//\n"
"// Detection is by checking whether the modulus is in the subgroup generated by \n"
"// 65537 modulo a set of small primes. Only primes where 65537 is not a generator of \n"
"// the multiplicative subgroup are used. To reduce footprint, we select primes\n"
"// with the best selectivity per byte of table space for a false-positive rate of\n"
"// less than 2^{-80}. We then sorted the primes with these most selective one first\n"
"// to optimize performance.\n"
"// A good key is detected as soon as we hit a prime where the key is not in the subgroup\n"
"// generated by 65537. Almost all good keys are detected by the very first prime which \n"
"// only lets 1:165 good keys through.\n"
"// Weak keys have to go through all primes in the table, and are the slowest, but we don't\n"
"// care about the performance of the weak key case.\n"
"//\n"
"\n"
);
// Look at all the primes and measure their selectivity for the detection
IFX_TPM_WEAK_KEY_PRIME_INFO primeInfo[IFX_N_PRIMES_IN_KEYGEN];
for( int i=0; i<IFX_N_PRIMES_IN_KEYGEN; i++ )
{
UINT32 p = g_smallPrimes[i];
UINT32 count = 0;
// Count how many values modulo p are generated by 65537
buildGeneratorBitmap( p, 65537, &workBuffer[0], &count );
primeInfo[i].prime = p;
CHECK( (p-1) % count == 0, "Math error" );
primeInfo[i].selectivity = (p-1) / count;
primeInfo[i].signalPerByte = (log( (double) primeInfo[i].selectivity ) / log((double)2)) / (2.0 + (UINT32)((p+7)/8) );
// p-1 is always a multiple of count because the order of an element is a divisor of the order of a group
//printf( "Raw: %3d, %3d, %0.6f\n", primeInfo[i].prime, primeInfo[i].selectivity, primeInfo[i].signalPerByte );
}
// Sort them by decreasing efficiency
qsort( &primeInfo[0], IFX_N_PRIMES_IN_KEYGEN, sizeof( primeInfo[0] ), compareIfxPrimeEfficiency );
UINT32 nPrimesToFilter = 0;
double filterLog = 0.0;
while( filterLog < 80.0 )
{
CHECK( nPrimesToFilter < IFX_N_PRIMES_IN_KEYGEN, "Filter requirement too selective" );
filterLog += log( (double)primeInfo[nPrimesToFilter].selectivity ) / log( (double) 2 );
// UINT32 i = nPrimesToFilter;
//printf( "Select: %3d, %3d, %0.6f\n", primeInfo[i].prime, primeInfo[i].selectivity, primeInfo[i].signalPerByte );
nPrimesToFilter++;
}
// Sort them by decreasing selectivity
qsort( &primeInfo[0], nPrimesToFilter, sizeof( primeInfo[0] ), compareIfxPrimeSelectivity );
UINT32 nBytesTotal = 0;
for( UINT32 i=0; i<nPrimesToFilter; i++ )
{
nBytesTotal += (primeInfo[i].prime + 7)/8 + 2;
//printf( "Tables: %3d, %3d, %0.6f\n", primeInfo[i].prime, primeInfo[i].selectivity, primeInfo[i].signalPerByte );
}
fprintf( f, "// %d primes using %d bytes give a false-positive rate of 2^-%3.2f\n\n", nPrimesToFilter, nBytesTotal, filterLog );
fprintf( f, "UINT16 g_SymCryptIfxTpmWeakKeysDetectionPrimeTable[] = {\n" );
for( UINT32 i=0; i<nPrimesToFilter; i++ )
{
UINT32 nBytes = (primeInfo[i].prime + 7)/8 + 2;
fprintf( f, " %3d, // filters 1:%3d, %2d bytes, signal/byte = %1.3f\n",
primeInfo[i].prime, primeInfo[i].selectivity, nBytes, primeInfo[i].signalPerByte );
}
fprintf( f,
" 0, // Sentinel\n"
"};\n"
"\n"
);
fprintf( f,
"// Bitmask table.\n"
"// For each prime p, there is a bitmask of (p+7)/8 bytes, with the i'th bit in the bitmask\n"
"// indicating that the value i is generated by 65537 modulo p. These bitmasks are stored \n"
"// consecutively in this array, in the order of the primes in the table above.\n"
"BYTE g_SymCryptIfxTpmWeakKeyDetectionBitmasks[] = {"
);
for( UINT32 i=0; i<nPrimesToFilter; i++ )
{
UINT32 p = primeInfo[i].prime;
UINT32 nBytes = (p + 7)/8;
UINT32 count;
char * sep = "";
fprintf( f, "\n\n // %d\n ", p );
buildGeneratorBitmap( p, 65537, &workBuffer[0], &count );
for( UINT32 j=0; j<nBytes; j++ )
{
fprintf( f, "%s0x%02x,", sep, workBuffer[j] );
sep = (j%16)==15 ? "\n " : " ";
}
}
fprintf( f, "\n};\n" );
/*
double logProb = 0;
UINT32 nFilterPrimes = 0;
for( UINT32 i=1; i<=nPrimesUsed; i++ ) // 126 primes were used in \PI
{
BYTE buf[1024];
memset( buf, 0, sizeof( buf ) );
UINT32 p = g_smallPrimes[i];
UINT32 s = 1;
UINT32 n = 0;
while( ( (buf[s/8] >> (s % 8)) & 1 ) == 0 )
{
buf[s/8] |= 1 << (s%8);
n++;
s = (s * 65537) % p;
}
if( n < p-1 )
{
fprintf( f, "{ %3d, ", p);
char * sep = "{";
for( UINT32 j=0; j<nBytesInTable; j++ )
{
fprintf( f, "%s 0x%02x", sep, buf[j] );
sep = j % 16 != 15 ? "," : "\n ";
}
double bitFiltered = (log( (double) p-1 ) - log( (double) n ) ) / log( (double) 2);
fprintf( f, " } }; // %1.1f bits filtered\n", bitFiltered );
logProb += bitFiltered;
nFilterPrimes += 1;
}
}
fprintf( f, "};\n" );
fprintf( f, "// # filter primes = %d\n", nFilterPrimes );
fprintf( f, "// 2-log of false-positive rate = %2.1f\n", logProb );
double piLen = 0;
for( UINT32 i=0; i<130; i++ )
{
piLen += log( (double) g_smallPrimes[i] ) / log( (double) 2 );
printf( "%3d: %3d, %5f\n", i, g_smallPrimes[i], piLen );
}
*/
}
VOID
createIfxTpmWeakKeyTable()
{
char * fileName = "IfxTpmWeakKeyTables.h_gen";
FILE * f = fopen( fileName, "wt" );
CHECK3( f != NULL, "Could not create file %s", fileName );
printIfxTpmWeakKeyTable( stdout );
printIfxTpmWeakKeyTable( f );
fclose( f );
}
int __cdecl
main( int argc, _In_reads_( argc ) char * argv[] )
{
printf( "SymCrypt constants generation program\n" );
generateSmallPrimes();
UNREFERENCED_PARAMETER( argc );
UNREFERENCED_PARAMETER( argv );
createFile( 32 ); // primes <= 21845 can still be 2 to a group in 32 bits mode
createFile( 64 ); // extra 30 ensures the last group is 'full', which is more efficient.
createIfxTpmWeakKeyTable();
exit(0);
}

67
gen/sources Normal file
Просмотреть файл

@ -0,0 +1,67 @@
TARGETNAME=symcryptConstantGen
TARGETTYPE=PROGRAM
UMTYPE=console
MSC_WARNING_LEVEL=/W4 /WX
# mark this as test code, as that re-enabled the __DATE__ and __TIME__ macros in the compiler.
TEST_CODE= 1
# TEST_CODE disables LTCG, this re-enables it
LINK_TIME_CODE_GENERATION = 1
INCLUDES= \
$(DS_INC_PATH); \
# $(DS_INC_PATH)\crypto; \
..\lib ; \
..\inc ; \
$(DDK_INC_PATH); \
SOURCES= \
main_gen.cpp \
#
# We link RSA32 and msbignum twice, once from the Enigma build location, and once from windows.
# This works in either state.
#
TARGETLIBS= \
# $(MINCORE_SDK_LIB_PATH)\mincore.lib \
$(MINWIN_SDK_LIB_PATH)\ntdll.lib \
!if EXIST( $(PROJECT_OBJ_ROOT)\released\windows\ntrsa32\umode\$(O)\rsa32.lib )
# $(PROJECT_OBJ_ROOT)\released\windows\ntrsa32\umode\$(O)\rsa32.lib \
!endif
# $(DS_LIB_PATH)\rsa32.lib \
!if EXIST( $(PROJECT_OBJ_ROOT)\released\windows\bignum\winnt\$(O)\msbignum.lib )
# $(PROJECT_OBJ_ROOT)\released\windows\bignum\winnt\$(O)\msbignum.lib \
!endif
# $(DS_LIB_PATH)\msbignum.lib \
$(SDK_LIB_PATH)\powrprof.lib \
$(SDK_LIB_PATH)\bcrypt.lib \
# $(PROJECT_OBJ_ROOT)\symcrypt\lib\$(O)\symcrypt.lib \
# $(PROJECT_OBJ_ROOT)\symcrypt\unittest\lib\$(O)\symcryptunittest_lib.lib \
UNICODE = 1
USE_MSVCRT=1
BUFFER_OVERFLOW_CHECKS=1
ENABLE_ISO_VOLATILE_WARNING=1
USE_STL = 1
STL_VER = 70
USE_NATIVE_EH = 1
MUI = 0
MUI_COMMENT = Unittest only, this is never localized
# Target OneCore
BUILD_FOR_CORESYSTEM=1
TARGETLIBS= \
$(TARGETLIBS) \
$(MINCORE_SDK_LIB_PATH)\mincore.lib \
$(MINCORE_SDK_LIB_PATH)\mincore_legacy.lib \
$(MINCORE_SDK_LIB_PATH)\mincore_obsolete.lib \
# $(MINWIN_PRIV_SDK_LIB_VPATH)\api-ms-win-security-cryptoapi-l1.lib \

5968
inc/symcrypt.h Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

271
inc/symcrypt_inline.h Normal file
Просмотреть файл

@ -0,0 +1,271 @@
//
// SymCrypt_inline.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Inline implementations for functions defined in symcrypt.h
//
///////////////////////////////////////////////////////////////
// Some functions and macros that we need for inlining code
///////////////////////////////////////////////////////////////
//
// SymCryptFatal
//
// Call the Fatal routine passed to the library upon initialization
//
_Analysis_noreturn_
VOID
SYMCRYPT_CALL
SymCryptFatal( UINT32 fatalCode );
//
// We use an ASSERT macro to catch problems in CHKed builds
// HARD_ASSERT checks also in FRE builds.
//
#define SYMCRYPT_HARD_ASSERT( _x ) \
{\
if( !(_x) ){ SymCryptFatal( 'asrt' ); }\
}\
_Analysis_assume_( _x )
#if defined( DBG )
#define SYMCRYPT_ASSERT( _x ) SYMCRYPT_HARD_ASSERT( _x )
#else
#define SYMCRYPT_ASSERT( _x ) \
_Analysis_assume_( _x )
#endif
//////////////////////////////////////////////////////////
//
// Environment macros
//
#ifdef __cplusplus
#define SYMCRYPT_EXTERN_C extern "C" {
#define SYMCRYPT_EXTERN_C_END }
#else
#define SYMCRYPT_EXTERN_C
#define SYMCRYPT_EXTERN_C_END
#endif
//
// Callers of SymCrypt should NOT depend on the function names in these macros.
// The definition of these macros can change in future releases of the library.
//
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_AMD64
typedef struct _SYMCRYPT_EXTENDED_SAVE_DATA SYMCRYPT_EXTENDED_SAVE_DATA, *PSYMCRYPT_EXTENDED_SAVE_DATA;
#define SYMCRYPT_ENVIRONMENT_DEFS_SAVEYMM( envName ) \
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSaveYmmEnv##envName( _Out_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ); \
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSaveYmm( _Out_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ) \
{ return SymCryptSaveYmmEnv##envName( pSaveArea ); } \
\
VOID SYMCRYPT_CALL SymCryptRestoreYmmEnv##envName( _Inout_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ); \
VOID SYMCRYPT_CALL SymCryptRestoreYmm( _Inout_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ) \
{ SymCryptRestoreYmmEnv##envName( pSaveArea ); } \
#define SYMCRYPT_ENVIRONMENT_DEFS_SAVEXMM( envName ) \
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSaveXmmEnv##envName( _Out_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ); \
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSaveXmm( _Out_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ) \
{ return SymCryptSaveXmmEnv##envName( pSaveArea ); } \
\
VOID SYMCRYPT_CALL SymCryptRestoreXmmEnv##envName( _Inout_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ); \
VOID SYMCRYPT_CALL SymCryptRestoreXmm( _Inout_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ) \
{ SymCryptRestoreXmmEnv##envName( pSaveArea ); } \
#else
#define SYMCRYPT_ENVIRONMENT_DEFS_SAVEYMM( envName )
#define SYMCRYPT_ENVIRONMENT_DEFS_SAVEXMM( envName )
#endif
#define SYMCRYPT_ENVIRONMENT_DEFS( envName ) \
SYMCRYPT_EXTERN_C \
VOID SYMCRYPT_CALL SymCryptInitEnv##envName(); \
VOID SYMCRYPT_CALL SymCryptInit() \
{ SymCryptInitEnv##envName(); } \
\
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatalEnv##envName( UINT32 fatalCode ); \
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatal( UINT32 fatalCode ) \
{ SymCryptFatalEnv##envName( fatalCode ); } \
SYMCRYPT_CPU_FEATURES SYMCRYPT_CALL SymCryptCpuFeaturesNeverPresentEnv##envName(); \
SYMCRYPT_CPU_FEATURES SYMCRYPT_CALL SymCryptCpuFeaturesNeverPresent() \
{ return SymCryptCpuFeaturesNeverPresentEnv##envName(); } \
\
SYMCRYPT_ENVIRONMENT_DEFS_SAVEXMM( envName ) \
SYMCRYPT_ENVIRONMENT_DEFS_SAVEYMM( envName ) \
\
VOID SYMCRYPT_CALL SymCryptTestInjectErrorEnv##envName( PBYTE pbBuf, SIZE_T cbBuf ); \
VOID SYMCRYPT_CALL SymCryptInjectError( PBYTE pbBuf, SIZE_T cbBuf ) \
{ SymCryptTestInjectErrorEnv##envName( pbBuf, cbBuf ); } \
SYMCRYPT_EXTERN_C_END
//
// To avoid hard-do-diagnose mistakes, we skip defining environment macros in those cases where we
// know they cannot or should not be used.
//
#define SYMCRYPT_ENVIRONMENT_GENERIC SYMCRYPT_ENVIRONMENT_DEFS( Generic )
#if defined(EFI) | defined(PCAT) | defined(DIRECT)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_BOOTLIBRARY SYMCRYPT_ENVIRONMENT_DEFS( WindowsBootlibrary )
#endif
//
// There are no defined symbols that we can use to detect that we are in debugger code
// But this is unlikely to be misued.
//
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELDEBUGGER SYMCRYPT_ENVIRONMENT_DEFS( WindowsKernelDebugger )
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_LEGACY SYMCRYPT_ENVIRONMENT_GENERIC
#if (NTDDI_VERSION >= NTDDI_WIN7)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_WIN7_N_LATER SYMCRYPT_ENVIRONMENT_DEFS( WindowsKernelmodeWin7nLater )
#endif
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_WIN8_1_N_LATER SYMCRYPT_ENVIRONMENT_DEFS( WindowsKernelmodeWin8_1nLater )
#endif
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_LATEST SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_WIN8_1_N_LATER
#define SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_LEGACY SYMCRYPT_ENVIRONMENT_GENERIC
#if (NTDDI_VERSION >= NTDDI_WIN7)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_WIN7_N_LATER SYMCRYPT_ENVIRONMENT_DEFS( WindowsUsermodeWin7nLater )
#endif
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_WIN8_1_N_LATER SYMCRYPT_ENVIRONMENT_DEFS( WindowsUsermodeWin8_1nLater )
#endif
#define SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_LATEST SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_WIN8_1_N_LATER
//////////////////////////////////////////////////////////
//
// SymCryptWipe & SymCryptWipeKnownSize
//
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_AMD64 | SYMCRYPT_CPU_ARM | SYMCRYPT_CPU_ARM64
//
// If the known size is large we call the generic wipe function anyway.
// For small known sizes we perform the wipe inline.
// We put the limit at 8 native writes, which varies by platform.
//
//
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_ARM
#define SYMCRYPT_WIPE_FUNCTION_LIMIT (32) // If this is increased beyond 64 the code below must be updated.
#elif SYMCRYPT_CPU_AMD64 | SYMCRYPT_CPU_ARM64
#define SYMCRYPT_WIPE_FUNCTION_LIMIT (64) // If this is increased beyond 64 the code below must be updated.
#else
#error ??
#endif
//
// The buffer analysis code doesn't understand our optimized in-line wiping code
// well enough to conclude it is safe.
//
#pragma prefast(push)
#pragma prefast( disable: 26001 )
FORCEINLINE
VOID
SYMCRYPT_CALL
#pragma prefast( suppress: 6101, "Logic why this properly initializes the pbData buffer is too complicated for prefast" )
SymCryptWipeKnownSize( _Out_writes_bytes_( cbData ) PVOID pbData, SIZE_T cbData )
{
volatile BYTE * pb = (volatile BYTE *) pbData;
if( cbData > SYMCRYPT_WIPE_FUNCTION_LIMIT )
{
SymCryptWipe( pbData, cbData );
} else
{
//
// We assume that pb is aligned, so we wipe from the end to the front to keep alignment.
//
if( cbData & 1 )
{
cbData--;
SYMCRYPT_FORCE_WRITE8( (volatile BYTE *) &pb[cbData], 0 );
}
if( cbData & 2 )
{
cbData -= 2;
SYMCRYPT_FORCE_WRITE16( (volatile UINT16 *) &pb[cbData], 0 );
}
if( cbData & 4 )
{
cbData -= 4;
SYMCRYPT_FORCE_WRITE32( (volatile UINT32 *) &pb[cbData], 0 );
}
if( cbData & 8 )
{
cbData -= 8;
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData], 0 );
}
if( cbData & 16 )
{
cbData -= 16;
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData ], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 8], 0 );
}
if( cbData & 32 )
{
cbData -= 32;
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData ], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 8], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 16], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 24], 0 );
}
#if SYMCRYPT_WIPE_FUNCTION_LIMIT >= 64
if( cbData & 64 )
{
cbData -= 64;
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData ], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 8], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 16], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 24], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 32], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 40], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 48], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 56], 0 );
}
#endif
}
}
#pragma prefast(pop)
#else // Platform switch for SymCryptWipeKnownSize
FORCEINLINE
VOID
SYMCRYPT_CALL
SymCryptWipeKnownSize( _Out_writes_bytes_( cbData ) PVOID pbData, SIZE_T cbData )
{
SymCryptWipe( pbData, cbData );
}
#endif // Platform switch for SymCryptWipeKnownSize

2133
inc/symcrypt_internal.h Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

2667
inc/symcrypt_low_level.h Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

47
inc/symcrypt_no_sal.h Normal file
Просмотреть файл

@ -0,0 +1,47 @@
//
// symcrypt_no_sal.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// This header file suppresses all SAL annotation for use in
// environments without SAL, such as iOS or Android.
//
#define _Success_(x)
#define _Analysis_noreturn_
#define _Analysis_assume_(x)
#define __analysis_assume(x)
#define _Use_decl_annotations_
#define _In_
#define _In_z_
#define _In_z_b
#define _In_opt_
#define _In_range_(x,y)
#define _In_reads_(x)
#define _In_reads_opt_(x)
#define _In_reads_bytes_(x)
#define _In_reads_bytes_opt_(x)
#define _Out_
#define _Out_writes_(x)
#define _Out_writes_to_(x,y)
#define _Out_writes_opt_(x)
#define _Out_writes_bytes_(x)
#define _Out_writes_bytes_to_(x,y)
#define _Out_writes_bytes_all_opt_(x)
#define _Inout_
#define _Inout_updates_(x)
#define _Inout_updates_bytes_(x)
#define _Inout_updates_opt_(x)
#define _Field_size_(x)
#define _Field_range_(x,y)
#define _Ret_range_(x,y)
#define _Must_inspect_result_

86
inc/symcrypt_types.h Normal file
Просмотреть файл

@ -0,0 +1,86 @@
//
// SymCrypt_types.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Datatypes used by the SymCrypt library. This ensures compatibility
// with multiple environments, such as Windows, iOS, and Android.
//
#ifdef WIN32
//
// Types included in intsafe.h:
// BYTE,
// INT16, UINT16,
// INT32, UINT32,
// INT64, UINT64,
// UINT_PTR
// and macro:
// UINT32_MAX
//
#include <intsafe.h>
#else
#include <stdint.h>
typedef uint8_t BYTE;
typedef int16_t INT16;
typedef uint16_t UINT16;
typedef int32_t INT32;
typedef uint32_t UINT32;
typedef int64_t INT64;
typedef uint64_t UINT64;
typedef uintptr_t UINT_PTR;
#ifndef UINT32_MAX
#define UINT32_MAX (0xffffffff)
#endif
// Boolean
typedef BYTE BOOLEAN;
#ifndef TRUE
#define TRUE 0x01
#endif
#ifndef FALSE
#define FALSE 0x00
#endif
// Size_t
typedef size_t SIZE_T;
#endif //WIN32
//
// Pointer types
//
typedef BYTE * PBYTE;
typedef const BYTE * PCBYTE;
typedef UINT16 * PUINT16;
typedef const UINT16 * PCUINT16;
typedef UINT32 * PUINT32;
typedef const UINT32 * PCUINT32;
typedef UINT64 * PUINT64;
typedef const UINT64 * PCUINT64;
// Void
#ifndef VOID
#define VOID void
#endif
typedef void * PVOID;
typedef const void * PCVOID;

41
inc/symcrypt_version.inc Normal file
Просмотреть файл

@ -0,0 +1,41 @@
;/*
; SymCrypt_version.inc
; Copyright (c) Microsoft Corporation. All rights reserved.
;
; This is the file that contains the SymCrypt version information. It is updated by the build system
; so that each version of the library has a unique version number.
;
; THIS FILE IS INCLUDED BOTH IN C AND ASSEMBLER CODE
; which is why the layout is strange.
; The first line is ";/_*" (without the _)
; which is an assembler comment, and the start of a C comment.
; (In C an extra semicolon is allowed.)
; (The extra _ is added above to not break compilers who violate the C standard and
; allow nested slash-star comments.)
; Below we have separate areas where the C and ASM version numbers are defined.
; These should always be the same.
;
; The API version is intended to change when we change the API behavior in a way that
; breaks backward compatibility. Currently this value is not used.
;
; The release version is incremented for every 'release' build.
; For private builds between releases the private version number is incremented.
;
SYMCRYPT_API_VERSION EQU 1
SYMCRYPT_CODE_VERSION_RELEASE EQU 86
SYMCRYPT_CODE_VERSION_PRIVATE EQU 0
if 0 ; Start an area that the assembler ignores
;*/ // End of C comment, the C compiler will read the lines below
#define SYMCRYPT_API_VERSION 1
#define SYMCRYPT_CODE_VERSION_RELEASE 86
#define SYMCRYPT_CODE_VERSION_PRIVATE 0
;/* ; Switch back into a C comment so that we can close the IF
endif
;*/

102
lib/C_asm_shared.inc Normal file
Просмотреть файл

@ -0,0 +1,102 @@
;/*
; C_asm_shared.inc file to synchronize C and Asm information
; Copyright (c) Microsoft Corporation. All rights reserved.
; This is a file that compiles both in C and ASM to define values in a way that is guaranteed to be the same on both sides.
; We use this to define the structure offsets that the ASM code uses.
; By having equivalent C constants we can add checks to the C code to ensure they are correct.
;
; This is an ugly hack, but it works :-)
;
; Due to the fact that the ARM assemblers use the C precompiler
; the C files have to redefine EQU to nothing before including this file.
; */
;const SIZE_T
SymCryptModulusNdigitsOffsetAmd64 EQU 4;
; const SIZE_T
SymCryptModulusMontgomeryInv64OffsetAmd64 EQU 32;
; const SIZE_T
SymCryptModulusValueOffsetAmd64 EQU 128;
;const SIZE_T
SymCryptModulusNdigitsOffsetX86 EQU 4;
; const SIZE_T
SymCryptModulusMontgomeryInv64OffsetX86 EQU 24;
; const SIZE_T
SymCryptModulusValueOffsetX86 EQU 96;
;const SIZE_T
SymCryptModulusNdigitsOffsetArm64 EQU 4;
; const SIZE_T
SymCryptModulusMontgomeryInv64OffsetArm64 EQU 32;
; const SIZE_T
SymCryptModulusValueOffsetArm64 EQU 128;
;const SIZE_T
SymCryptModulusNdigitsOffsetArm EQU 4;
; const SIZE_T
SymCryptModulusMontgomeryInv64OffsetArm EQU 24;
; const SIZE_T
SymCryptModulusValueOffsetArm EQU 96;
; /*
IF 0
; */
#undef EQU
#if SYMCRYPT_CPU_AMD64
#define SYMCRYPT_CHECK_ASM_OFFSETS \
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusNdigitsOffsetAmd64, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, nDigits ) );\
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusMontgomeryInv64OffsetAmd64, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, tm.montgomery.inv64 ));\
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusValueOffsetAmd64, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, Divisor.Int.ti.fdef.uint32 ));\
#elif SYMCRYPT_CPU_X86
#define SYMCRYPT_CHECK_ASM_OFFSETS \
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusNdigitsOffsetX86, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, nDigits ) );\
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusMontgomeryInv64OffsetX86, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, tm.montgomery.inv64 ));\
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusValueOffsetX86, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, Divisor.Int.ti.fdef.uint32 ));\
#elif SYMCRYPT_CPU_ARM64
#define SYMCRYPT_CHECK_ASM_OFFSETS \
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusNdigitsOffsetArm64, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, nDigits ) );\
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusMontgomeryInv64OffsetArm64, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, tm.montgomery.inv64 ));\
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusValueOffsetArm64, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, Divisor.Int.ti.fdef.uint32 ));\
#elif SYMCRYPT_CPU_ARM
#define SYMCRYPT_CHECK_ASM_OFFSETS \
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusNdigitsOffsetArm, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, nDigits ) );\
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusMontgomeryInv64OffsetArm, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, tm.montgomery.inv64 ));\
SYMCRYPT_CHECK_ASM_OFFSET( SymCryptModulusValueOffsetArm, SYMCRYPT_FIELD_OFFSET( SYMCRYPT_MODULUS, Divisor.Int.ti.fdef.uint32 ));\
#endif // CPU_*
#if !defined( SYMCRYPT_CHECK_ASM_OFFSETS)
#define SYMCRYPT_CHECK_ASM_OFFSETS
#endif
; /*
ENDIF
; */

71
lib/hash_buffer_pattern.c Normal file
Просмотреть файл

@ -0,0 +1,71 @@
//
// hash_buffer_pattern.c
// Copyright (c) Microsoft Corporation. All rights reserved.
//
/*
SymCryptXxxAppend( _Inout_ SYMCRYPT_Xxx_STATE * state,
_In_reads_bytes_( cbData ) PCBYTE pbData,
SIZE_T cbData )
{
<Set up a SIZE_T variable 'bytesInBuffer' that contains the # bytes in the buffer>
*/
//
// Truncate bytesInBuffer so that we never have an integer overflow.
//
bytesInBuffer &= SYMCRYPT_XXX_INPUT_BLOCK_SIZE - 1;
//
// If previous data in buffer, buffer new input and transform if possible.
//
if (bytesInBuffer > 0)
{
SIZE_T freeInBuffer = SYMCRYPT_XXX_INPUT_BLOCK_SIZE - bytesInBuffer;
if( cbData < freeInBuffer )
{
//
// All the data will fit in the buffer.
// We don't do anything here.
// As cbData < INPUT_BLOCK_SIZE the bulk data processing is skipped,
// and the data will be copied to the buffer at the end
// of this code.
} else {
//
// Enough data to fill the whole buffer & process it
//
memcpy(&state->buffer[bytesInBuffer], pbData, freeInBuffer);
pbData += freeInBuffer;
cbData -= freeInBuffer;
SYMCRYPT_XxxAppendBlocks( &state->chain, state->buffer, SYMCRYPT_XXX_INPUT_BLOCK_SIZE );
//
// Set bytesInBuffer to zero to ensure that the trailing data in the
// buffer will be copied to the right location of the buffer below.
//
bytesInBuffer = 0;
}
}
//
// Internal buffer is empty; process all remaining whole blocks in the input
//
if( cbData >= SYMCRYPT_XXX_INPUT_BLOCK_SIZE )
{
SIZE_T cbDataRoundedDown = cbData & ~(SIZE_T)(SYMCRYPT_XXX_INPUT_BLOCK_SIZE - 1);
SYMCRYPT_XxxAppendBlocks( &state->chain, pbData, cbDataRoundedDown );
pbData += cbDataRoundedDown;
cbData -= cbDataRoundedDown;
}
//
// buffer remaining input if necessary.
//
if( cbData > 0 )
{
memcpy( &state->buffer[bytesInBuffer], pbData, cbData );
}
/*
}
*/

517
lib/libmain.c Normal file
Просмотреть файл

@ -0,0 +1,517 @@
//
// libmain.c
// General routines for the SymCrypt library
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "precomp.h"
#define EQU =
#include "C_asm_shared.inc"
// The following global g_SymCryptFlags has to be at least 32
// bits because the iOS environment has interlocked function
// support for variables of size at least 32 bits.
// The relevant function is OSAtomicOr32Barrier.
UINT32 g_SymCryptFlags = 0;
SYMCRYPT_CPU_FEATURES g_SymCryptCpuFeaturesNotPresent = (SYMCRYPT_CPU_FEATURES) ~0;
SYMCRYPT_CPU_FEATURES g_SymCryptCpuFeaturesPresentCheck = 0;
#if defined( DBG )
SYMCRYPT_NOINLINE
VOID
SYMCRYPT_CALL
SymCryptLibraryWasNotInitialized()
{
SymCryptFatal( 'init' ); // Function name helps figure out what the problem is.
}
#endif
VOID
SYMCRYPT_CALL
SymCryptInitEnvCommon()
// Returns TRUE if the initializatoin steps have to be performed.
{
UINT32 tmp;
//
// Use an interlocked to set the flag in case we add other flags
// that are modified by different threads.
//
ATOMIC_OR32( &g_SymCryptFlags, SYMCRYPT_FLAG_LIB_INITIALIZED );
//
// Do a forced write of our code version. This ensures that the code
// version is part of the binary, so we can look at a binary and figure
// out which version of SymCrypt it was linked with.
//
SYMCRYPT_FORCE_WRITE32( &tmp, SYMCRYPT_CODE_VERSION );
//
// Make an inverted copy of the CPU detection results.
// This helps us diagnose corruption of our flags
// Force-write otherwise the compiler optimizes it away
//
SYMCRYPT_FORCE_WRITE32( &g_SymCryptCpuFeaturesPresentCheck, ~g_SymCryptCpuFeaturesNotPresent );
//
// Test that the C and assembler code agree on the various structure member offsets.
// This gets optimized away in FRE builds as all the values are compile-time computable.
//
#define SYMCRYPT_CHECK_ASM_OFFSET( a, b ) if( (a) != (b) ) {SymCryptFatal( b );}
SYMCRYPT_CHECK_ASM_OFFSETS;
#undef SYMCRYPT_CHECK_ASM_OFFSET
}
_Analysis_noreturn_
SYMCRYPT_NOINLINE
VOID
SYMCRYPT_CALL
SymCryptFatalHang( UINT32 fatalCode )
//
// This function is used by the environment-specific fatal code
// as a last resort when none of the other fatal methods work.
//
{
UINT32 fcode;
//
// Put the fatal code in a location we can find
//
SYMCRYPT_FORCE_WRITE32( &fcode, fatalCode );
fatalInfiniteLoop:
goto fatalInfiniteLoop;
}
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_AMD64 | SYMCRYPT_CPU_ARM | SYMCRYPT_CPU_ARM64
VOID
SYMCRYPT_CALL
SymCryptWipeAsm( _Out_writes_bytes_( cbData ) PVOID pbData, SIZE_T cbData );
VOID
SYMCRYPT_CALL
SymCryptWipe( _Out_writes_bytes_( cbData ) PVOID pbData, SIZE_T cbData )
{
SymCryptWipeAsm( pbData, cbData );
}
#else
//
// Generic but slow wipe routine.
//
VOID
SYMCRYPT_CALL
SymCryptWipe( _Out_writes_bytes_( cbData ) PVOID pbData, SIZE_T cbData )
{
volatile BYTE * p = (volatile BYTE *) pbData;
SIZE_T i;
for( i=0; i<cbData; i++ ){
p[i] = 0;
}
}
#endif
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_ARM
VOID
SYMCRYPT_CALL
SymCryptXorBytes(
_In_reads_( cbBytes ) PCBYTE pbSrc1,
_In_reads_( cbBytes ) PCBYTE pbSrc2,
_Out_writes_( cbBytes ) PBYTE pbResult,
SIZE_T cbBytes )
{
SIZE_T i;
if( cbBytes == 16 )
{
PCUINT32 s1 = (PCUINT32) pbSrc1;
PCUINT32 s2 = (PCUINT32) pbSrc2;
PUINT32 d = (PUINT32) pbResult;
d[0] = s1[0] ^ s2[0];
d[1] = s1[1] ^ s2[1];
d[2] = s1[2] ^ s2[2];
d[3] = s1[3] ^ s2[3];
}
else
{
i = 0;
while( i + 3 < cbBytes )
{
*(UINT32 *)&pbResult[i] = *(UINT32 *)&pbSrc1[i] ^ *(UINT32 *)&pbSrc2[i];
i += 4;
}
while( i < cbBytes )
{
pbResult[i] = pbSrc1[i] ^ pbSrc2[i];
i++;
}
}
}
#elif SYMCRYPT_CPU_AMD64 | SYMCRYPT_CPU_ARM64
VOID
SYMCRYPT_CALL
SymCryptXorBytes(
_In_reads_( cbBytes ) PCBYTE pbSrc1,
_In_reads_( cbBytes ) PCBYTE pbSrc2,
_Out_writes_( cbBytes ) PBYTE pbResult,
SIZE_T cbBytes )
{
if( cbBytes == 16 )
{
PCUINT64 s1 = (PCUINT64) pbSrc1;
PCUINT64 s2 = (PCUINT64) pbSrc2;
PUINT64 d = (PUINT64) pbResult;
d[0] = s1[0] ^ s2[0];
d[1] = s1[1] ^ s2[1];
}
else
{
while( cbBytes >= 8 )
{
*(UINT64 *)pbResult = *(UINT64 *)pbSrc1 ^ *(UINT64 *)pbSrc2;
pbSrc1 += 8;
pbSrc2 += 8;
pbResult += 8;
cbBytes -= 8;
}
while( cbBytes > 0 )
{
*pbResult = *pbSrc1 ^ *pbSrc2;
pbResult++;
pbSrc1++;
pbSrc2++;
cbBytes--;
}
}
}
#else
//
// Generic code
//
VOID
SYMCRYPT_CALL
SymCryptXorBytes(
_In_reads_( cbBytes ) PCBYTE pbSrc1,
_In_reads_( cbBytes ) PCBYTE pbSrc2,
_Out_writes_( cbBytes ) PBYTE pbResult,
SIZE_T cbBytes )
{
SIZE_T i;
for( i=0; i<cbBytes; i++ )
{
pbResult[i] = pbSrc1[i] ^ pbSrc2[i];
}
}
#endif
//
// Generic LSB/MSBfirst load/store code for variable-sized buffers.
// These implementations are inefficient and not side-channel safe.
// This is sufficient for the current usage (typically to allow
// callers to read/write RSA public exponents from/to variable-sized
// buffers).
// Consider upgrading them in future.
//
UINT32
SymCryptUint32Bitsize( UINT32 value )
//
// Some CPUs/compilers have intriniscs for this,
// but this is portable and works everywhere.
//
{
UINT32 res;
res = 0;
while( value != 0 )
{
res += 1;
value >>= 1;
}
return res;
}
UINT32
SymCryptUint64Bitsize( UINT64 value )
{
UINT32 res;
UINT32 upper;
upper = (UINT32)(value >> 32);
if( upper == 0 )
{
res = SymCryptUint32Bitsize( (UINT32) value );
} else {
res = 32 + SymCryptUint32Bitsize( upper );
}
return res;
}
UINT32
SymCryptUint32Bytesize( UINT32 value )
{
if( value == 0 )
{
return 0;
}
if( value < 0x100 )
{
return 1;
}
if( value < 0x10000 )
{
return 2;
}
if( value < 0x1000000 )
{
return 3;
}
return 4;
}
UINT32
SymCryptUint64Bytesize( UINT64 value )
{
UINT32 res;
UINT32 upper;
upper = (UINT32)(value >> 32);
if( upper == 0 )
{
res = SymCryptUint32Bytesize( (UINT32) value );
} else {
res = 4 + SymCryptUint32Bytesize( upper );
}
return res;
}
SYMCRYPT_ERROR
SYMCRYPT_CALL
SymCryptLoadLsbFirstUint32(
_In_reads_( cbSrc ) PCBYTE pbSrc,
SIZE_T cbSrc,
_Out_ PUINT32 pDst )
{
UINT64 v64;
UINT32 v32;
SYMCRYPT_ERROR scError;
scError = SymCryptLoadLsbFirstUint64( pbSrc, cbSrc, &v64 );
if( scError != SYMCRYPT_NO_ERROR )
{
goto cleanup;
}
v32 = (UINT32) v64;
if( v32 != v64 )
{
scError = SYMCRYPT_VALUE_TOO_LARGE;
goto cleanup;
}
*pDst = v32;
cleanup:
return scError;
}
SYMCRYPT_ERROR
SYMCRYPT_CALL
SymCryptLoadLsbFirstUint64(
_In_reads_( cbSrc ) PCBYTE pbSrc,
SIZE_T cbSrc,
_Out_ PUINT64 pDst )
{
UINT64 v;
SYMCRYPT_ERROR scError = SYMCRYPT_NO_ERROR;
v = 0;
pbSrc += cbSrc;
while( cbSrc > 8 )
{
if( *--pbSrc != 0 )
{
scError = SYMCRYPT_VALUE_TOO_LARGE;
goto cleanup;
}
cbSrc--;
}
while( cbSrc > 0 )
{
v = (v << 8) | *--pbSrc;
cbSrc--;
}
*pDst = v;
cleanup:
return scError;
}
SYMCRYPT_ERROR
SYMCRYPT_CALL
SymCryptLoadMsbFirstUint32(
_In_reads_( cbSrc ) PCBYTE pbSrc,
SIZE_T cbSrc,
_Out_ PUINT32 pDst )
{
UINT64 v64;
UINT32 v32;
SYMCRYPT_ERROR scError;
scError = SymCryptLoadMsbFirstUint64( pbSrc, cbSrc, &v64 );
if( scError != SYMCRYPT_NO_ERROR )
{
goto cleanup;
}
v32 = (UINT32) v64;
if( v32 != v64 )
{
scError = SYMCRYPT_VALUE_TOO_LARGE;
goto cleanup;
}
*pDst = v32;
cleanup:
return scError;
}
SYMCRYPT_ERROR
SYMCRYPT_CALL
SymCryptLoadMsbFirstUint64(
_In_reads_( cbSrc ) PCBYTE pbSrc,
SIZE_T cbSrc,
_Out_ PUINT64 pDst )
{
UINT64 v;
SYMCRYPT_ERROR scError = SYMCRYPT_NO_ERROR;
v = 0;
while( cbSrc > 8 )
{
if( *pbSrc++ != 0 )
{
scError = SYMCRYPT_VALUE_TOO_LARGE;
goto cleanup;
}
cbSrc--;
}
while( cbSrc > 0 )
{
v = (v << 8) | *pbSrc++;
cbSrc--;
}
*pDst = v;
cleanup:
return scError;
}
SYMCRYPT_ERROR
SYMCRYPT_CALL
SymCryptStoreLsbFirstUint32(
UINT32 src,
_Out_writes_( cbDst ) PBYTE pbDst,
SIZE_T cbDst )
{
return SymCryptStoreLsbFirstUint64( src, pbDst, cbDst );
}
SYMCRYPT_ERROR
SYMCRYPT_CALL
SymCryptStoreLsbFirstUint64(
UINT64 src,
_Out_writes_( cbDst ) PBYTE pbDst,
SIZE_T cbDst )
{
SYMCRYPT_ERROR scError = SYMCRYPT_NO_ERROR;
while( cbDst > 0 )
{
*pbDst++ = (BYTE) src;
src >>= 8;
cbDst--;
}
if( src != 0 )
{
scError = SYMCRYPT_VALUE_TOO_LARGE;
goto cleanup;
}
cleanup:
return scError;
}
SYMCRYPT_ERROR
SYMCRYPT_CALL
SymCryptStoreMsbFirstUint32(
UINT32 src,
_Out_writes_( cbDst ) PBYTE pbDst,
SIZE_T cbDst )
{
return SymCryptStoreMsbFirstUint64( src, pbDst, cbDst );
}
SYMCRYPT_ERROR
SYMCRYPT_CALL
SymCryptStoreMsbFirstUint64(
UINT64 src,
_Out_writes_( cbDst ) PBYTE pbDst,
SIZE_T cbDst )
{
SYMCRYPT_ERROR scError = SYMCRYPT_NO_ERROR;
pbDst += cbDst;
while( cbDst > 0 )
{
*--pbDst = (BYTE) src;
src >>= 8;
cbDst--;
}
if( src != 0 )
{
scError = SYMCRYPT_VALUE_TOO_LARGE;
goto cleanup;
}
cleanup:
return scError;
}

333
lib/marvin32.c Normal file
Просмотреть файл

@ -0,0 +1,333 @@
//
// Marvin32.c
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// This module contains the routines to implement the Marvin32 checksum function
//
//
#include "precomp.h"
//
// See the symcrypt.h file for documentation on what the various functions do.
//
//
// Default initial seed, first 8 bytes of SHA256( "Marvin32" );
//
static const SYMCRYPT_MARVIN32_EXPANDED_SEED SymCryptMarvin32DefaultSeedStruct = {
{0xcd0893b7, 0xd53cd9ce},
#if defined( SYMCRYPT_MAGIC_ENABLED )
SYMCRYPT_MAGIC_VALUE( &SymCryptMarvin32DefaultSeedStruct ),
#endif
};
PCSYMCRYPT_MARVIN32_EXPANDED_SEED const SymCryptMarvin32DefaultSeed = &SymCryptMarvin32DefaultSeedStruct;
//
// Round rotation amounts. This array is optimized away by the compiler
// as we inline all our rotations.
//
static const int rotate[4] = {
20, 9, 27, 19,
};
_Success_(return == SYMCRYPT_NO_ERROR)
SYMCRYPT_ERROR
SYMCRYPT_CALL
SymCryptMarvin32ExpandSeed(
_Out_ PSYMCRYPT_MARVIN32_EXPANDED_SEED pExpandedSeed,
_In_reads_(cbSeed) PCBYTE pbSeed,
SIZE_T cbSeed )
{
SYMCRYPT_ERROR scError = SYMCRYPT_NO_ERROR;
if( cbSeed != SYMCRYPT_MARVIN32_SEED_SIZE )
{
scError = SYMCRYPT_WRONG_KEY_SIZE;
goto cleanup;
}
pExpandedSeed->s[0] = SYMCRYPT_LOAD_LSBFIRST32( pbSeed );
pExpandedSeed->s[1] = SYMCRYPT_LOAD_LSBFIRST32( pbSeed + 4 );
SYMCRYPT_SET_MAGIC( pExpandedSeed );
cleanup:
return scError;
}
VOID
SYMCRYPT_CALL
SymCryptMarvin32SeedCopy( _In_ PCSYMCRYPT_MARVIN32_EXPANDED_SEED pSrc,
_Out_ PSYMCRYPT_MARVIN32_EXPANDED_SEED pDst )
{
SYMCRYPT_CHECK_MAGIC( pSrc );
*pDst = *pSrc;
SYMCRYPT_SET_MAGIC( pDst );
}
VOID
SYMCRYPT_CALL
SymCryptMarvin32StateCopy(
_In_ PCSYMCRYPT_MARVIN32_STATE pSrc,
_In_opt_ PCSYMCRYPT_MARVIN32_EXPANDED_SEED pExpandedSeed,
_Out_ PSYMCRYPT_MARVIN32_STATE pDst )
{
SYMCRYPT_CHECK_MAGIC( pSrc );
*pDst = *pSrc;
if( pExpandedSeed == NULL )
{
SYMCRYPT_CHECK_MAGIC( pSrc->pSeed );
pDst->pSeed = pSrc->pSeed;
}
else
{
SYMCRYPT_CHECK_MAGIC( pExpandedSeed );
pDst->pSeed = pExpandedSeed;
}
SYMCRYPT_SET_MAGIC( pDst );
}
VOID
SYMCRYPT_CALL
SymCryptMarvin32Init( _Out_ PSYMCRYPT_MARVIN32_STATE pState,
_In_ PCSYMCRYPT_MARVIN32_EXPANDED_SEED pExpandedSeed)
{
pState->chain = *pExpandedSeed;
pState->dataLength = 0;
pState->pSeed = pExpandedSeed;
*(UINT32 *) &pState->buffer[4] = 0; // wipe the last 4 bytes of the buffer.
SYMCRYPT_SET_MAGIC( pState );
}
//
// SymCryptMarvin32Append
//
VOID
SYMCRYPT_CALL
SymCryptMarvin32Append( _Inout_ PSYMCRYPT_MARVIN32_STATE state,
_In_reads_( cbData ) PCBYTE pbData,
SIZE_T cbData )
{
UINT32 bytesInBuffer = state->dataLength;
SYMCRYPT_CHECK_MAGIC( state );
state->dataLength += (UINT32) cbData; // We only keep track of the last 2 bits...
#define ALG MARVIN32
#define Alg Marvin32
#include "hash_buffer_pattern.c"
#undef ALG
#undef Alg
}
//
// SymCryptMarvin32Result
//
VOID
SYMCRYPT_CALL
SymCryptMarvin32Result(
_Inout_ PSYMCRYPT_MARVIN32_STATE pState,
_Out_writes_( SYMCRYPT_MARVIN32_RESULT_SIZE ) PBYTE pbResult )
{
SIZE_T bytesInBuffer = ( pState->dataLength) & 0x3;
SYMCRYPT_CHECK_MAGIC( pState );
//
// Wipe four bytes in the buffer.
// Doing this first ensures that this write is aligned when the input was of
// length 0 mod 4.
// The buffer is 8 bytes long, so we never overwrite anything else.
//
*(UINT32 *) &pState->buffer[bytesInBuffer] = 0;
//
// The buffer is never completely full, so we can always put the first
// padding byte in.
//
pState->buffer[bytesInBuffer++] = 0x80;
//
// Process the final block
//
SymCryptMarvin32AppendBlocks( &pState->chain, pState->buffer, 8 );
SYMCRYPT_STORE_LSBFIRST32( pbResult , pState->chain.s[0] );
SYMCRYPT_STORE_LSBFIRST32( pbResult + 4, pState->chain.s[1] );
//
// Wipe only those things that we need to wipe.
//
*(UINT32 *) &pState->buffer[0] = 0;
pState->dataLength = 0;
pState->chain = *pState->pSeed;
}
#define BLOCK( a, b ) \
{\
b ^= a; a = ROL32( a, rotate[0] );\
a += b; b = ROL32( b, rotate[1] );\
b ^= a; a = ROL32( a, rotate[2] );\
a += b; b = ROL32( b, rotate[3] );\
}
VOID
SYMCRYPT_CALL
SymCryptMarvin32AppendBlocks(
_Inout_ PSYMCRYPT_MARVIN32_CHAINING_STATE pChain,
_In_reads_( cbData ) PCBYTE pbData,
SIZE_T cbData )
{
UINT32 s0 = pChain->s[0];
UINT32 s1 = pChain->s[1];
SIZE_T bytesInFirstBlock = cbData & 0xc; // 0, 4, 8, or 12
SYMCRYPT_ASSERT( (cbData & 3) == 0 );
pbData += bytesInFirstBlock;
cbData -= bytesInFirstBlock;
switch( bytesInFirstBlock )
{
case 0: // This handles the cbData == 0 case too
while( cbData > 0 )
{
pbData += 16;
cbData -= 16;
s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData - 16 );
BLOCK( s0, s1 );
case 12:
s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData - 12 );
BLOCK( s0, s1 );
case 8:
s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData - 8 );
BLOCK( s0, s1 );
case 4:
s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData - 4 );
BLOCK( s0, s1 );
}
}
pChain->s[0] = s0;
pChain->s[1] = s1;
}
VOID
SYMCRYPT_CALL
SymCryptMarvin32(
_In_ PCSYMCRYPT_MARVIN32_EXPANDED_SEED pExpandedSeed,
_In_reads_( cbData ) PCBYTE pbData,
SIZE_T cbData,
_Out_writes_( SYMCRYPT_MARVIN32_RESULT_SIZE ) PBYTE pbResult )
//
// To reduce the per-computation overhead, we have a dedicated code here instead of the whole Init/Append/Result stuff.
//
{
UINT32 tmp;
UINT32 s0 = pExpandedSeed->s[0];
UINT32 s1 = pExpandedSeed->s[1];
while( cbData > 7 )
{
s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData );
BLOCK( s0, s1 );
s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData + 4 );
BLOCK( s0, s1 );
pbData += 8;
cbData -= 8;
}
/*
switch( cbData )
{
case 3:
buf[2] = pbData[2];
case 2:
*(UINT16 *) &buf[0] = *(UINT16 *) pbData;
break;
case 1:
buf[0] = pbData[0];
case 0:
;
}
buf[ cbData ] = 0x80;
s0 += LOAD_LSBFIRST32( buf );
*/
switch( cbData )
{
default:
case 4: s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData ); BLOCK( s0, s1 ); pbData += 4;
case 0: tmp = 0x80; break;
case 5: s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData ); BLOCK( s0, s1 ); pbData += 4;
case 1: tmp = 0x8000 | pbData[0]; break;
case 6: s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData ); BLOCK( s0, s1 ); pbData += 4;
case 2: tmp = 0x800000 | SYMCRYPT_LOAD_LSBFIRST16( pbData ); break;
case 7: s0 += SYMCRYPT_LOAD_LSBFIRST32( pbData ); BLOCK( s0, s1 ); pbData += 4;
case 3: tmp = SYMCRYPT_LOAD_LSBFIRST16( pbData ) | (pbData[2] << 16) | 0x80000000; break;
}
s0 += tmp;
BLOCK( s0, s1 );
BLOCK( s0, s1 );
SYMCRYPT_STORE_LSBFIRST32( pbResult , s0 );
SYMCRYPT_STORE_LSBFIRST32( pbResult + 4, s1 );
}
//
// Simple test vector
//
static const BYTE marvin32KATAnswer[ 8 ] = {
0xbf, 0x69, 0x27, 0x49, 0x39, 0x43, 0xc7, 0x22,
} ;
VOID
SYMCRYPT_CALL
SymCryptMarvin32Selftest()
{
BYTE res[SYMCRYPT_MARVIN32_RESULT_SIZE];
SymCryptMarvin32( SymCryptMarvin32DefaultSeed, SymCryptTestMsg3, sizeof( SymCryptTestMsg3 ), res );
SymCryptInjectError( res, sizeof( res ) );
if( memcmp( res, marvin32KATAnswer, sizeof( res ) ) != 0 )
{
SymCryptFatal( 'marv' );
}
}

40
lib/precomp.h Normal file
Просмотреть файл

@ -0,0 +1,40 @@
//
// SymCrypt library pre-compiled header file
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#ifdef __cplusplus
#error C++
#endif
#include <stdlib.h>
#if defined(_MSC_VER)
#include <windows.h>
#define ATOMIC_OR32(_dest, _val) InterlockedOr( (volatile LONG *)(_dest), (LONG)(_val) )
#elif defined(__APPLE_CC__)
#include "precomp_iOS.h"
#define ATOMIC_OR32(_dest, _val) OSAtomicOr32Barrier( (uint32_t)(_val), (volatile uint32_t *)(_dest) )
#else
#error Unknown compiler
#endif
#include "symcrypt.h"
#include "sc_lib.h"
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_AMD64
#include <wmmintrin.h>
#include <immintrin.h>
#elif SYMCRYPT_CPU_ARM
#include <arm_neon.h>
#elif SYMCRYPT_CPU_ARM64
#include <arm64_neon.h>
#endif

58
lib/sc_lib-testhooks.h Normal file
Просмотреть файл

@ -0,0 +1,58 @@
//
// sc_lib-testhooks.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// The declarations from sc_lib.h that our unit test code also needs without all the other things in the sc_lib.h file.
//
//
// Global flags
//
#define SYMCRYPT_FLAG_LIB_INITIALIZED 0x00000001
extern UINT32 g_SymCryptFlags;
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_AMD64
#define SYMCRYPT_CPUID_DETECT_FLAG_CHECK_OS_SUPPORT_FOR_YMM 1 // enable checking of OSXSAVE bit & XGETBV logic
VOID
SYMCRYPT_CALL
SymCryptDetectCpuFeaturesByCpuid( UINT32 flags );
#elif SYMCRYPT_CPU_ARM | SYMCRYPT_CPU_ARM64
VOID
SYMCRYPT_CALL
SymCryptDetectCpuFeaturesFromRegisters();
VOID
SYMCRYPT_CALL
SymCryptDetectCpuFeaturesFromIsProcessorFeaturePresent();
#endif
#if SYMCRYPT_CPU_ARM64
VOID
SYMCRYPT_CALL
SymCryptDetectCpuFeaturesFromRegistersNoTry();
#endif
//==============================================================================================
// Common environment functions
//==============================================================================================
VOID
SYMCRYPT_CALL
SymCryptInitEnvCommon();
_Analysis_noreturn_
VOID
SYMCRYPT_CALL
SymCryptFatalHang( UINT32 fatalcode );

3228
lib/sc_lib.h Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

168
lib/sources Normal file
Просмотреть файл

@ -0,0 +1,168 @@
#----------------------------------------------------------------------------
#
# Description:
#
# sources file for symcrypt cryptography library
#
# History:
#
#
#----------------------------------------------------------------------------
TARGETNAME = symcrypt
TARGETTYPE=LIBRARY
KM_LIBRARY = 1 # enable /kernel flag & epilogue metadata
GUARD = 1 # enable CFG
ENABLE_ASM_RETPOLINE = 1
ENABLE_RETPOLINE_LINKER_WARNING = 1
# Enable /Gy for all assembler code
ASM_DEFINES=$(ASM_DEFINES) /Gy
INCLUDES= \
..\inc; \
$(DS_INC_PATH)\crypto; \
$(IFSKIT_INC_PATH); \
$(MINWIN_PRIV_SDK_INC_PATH)\boot; \
SOURCES= \
blockciphermodes.c \
hash.c \
parhash.c \
ccm.c \
ghash.c \
gcm.c \
aes-default.c \
aes-default-bc.c \
aes-key.c \
aes-c.c \
aes-asm.c \
aes-xmm.c \
aes-neon.c \
aes-selftest.c \
aesTables.c \
aescmac.c \
xtsaes.c \
3des.c \
desTables.c \
desx.c \
rc2.c \
rc4.c \
sha1.c \
sha256.c \
sha512.c \
md5.c \
md4.c \
md2.c \
hmacmd5.c \
hmacsha1.c \
hmacsha256.c \
hmacsha384.c \
hmacsha512.c \
tlsCbcVerify.c \
aesCtrDrbg.c \
libmain.c \
equal.c \
env_windowsUserModeWin7.c \
env_windowsUserModeWin8_1.c \
env_windowsKernelModeWin7.c \
env_windowsKernelModeWin8_1.c \
env_windowsBootLib.c \
env_generic.c \
env_windowsKernelDebugger.c \
fatalIntercept.c \
selftest.c \
rdrand.c \
rdseed.c \
sha256Par.c \
sha512Par.c \
marvin32.c \
cpuid.c \
cpuid_um.c \
cpuid_notry.c \
pbkdf2.c \
pbkdf2_hmacsha1.c \
pbkdf2_hmacsha256.c \
sp800_108.c \
sp800_108_hmacsha1.c \
sp800_108_hmacsha256.c \
tlsprf.c \
tlsprf_selftest.c \
hkdf.c \
hkdf_selftest.c \
chacha20.c \
poly1305.c \
\
a_dispatch.c \
fdef_general.c \
fdef_int.c \
fdef_mod.c \
fdef369_mod.c \
ecpoint.c \
ecurve.c \
eckey.c \
ec_dispatch.c \
ec_short_weierstrass.c \
ec_internal_curves.c \
ec_dsa.c \
ec_dh.c \
ec_montgomery.c \
ec_twisted_edwards.c \
ec_mul.c \
ScsTable.c \
primes.c \
modexp.c \
gen_int.c \
crt.c \
rsakey.c \
rsa_enc.c \
rsa_padding.c \
dlgroup.c \
dlkey.c \
dsa.c \
dh.c \
recoding.c \
IEEE802_11SaeCustom.c \
AMD64_SOURCES = \
# sha1asm.asm \
wipe.asm \
aesasm.asm \
fdef_asm.asm \
fdef369_asm.asm \
fdef_mulx.asm \
I386_SOURCES = \
# sha1asm.asm \
aesasm.asm \
wipe.asm \
# rc4asm.asm \
fdef_asm.asm \
ARM_SOURCES = \
fdef_asm.asm \
wipe.asm \
aesasm.asm \
ARM64_SOURCES = \
fdef_asm.asm \
fdef369_asm.asm \
wipe.asm \
SOURCES= marvin32.c
AMD64_SOURCES =
I386_SOURCES =
ARM_SOURCES =
ARM64_SOURCES =
BUFFER_OVERFLOW_CHECKS=1
MSC_WARNING_LEVEL= /W4 /WX
ENABLE_ISO_VOLATILE_WARNING=1
#PRECOMPILED_INCLUDE = ..\precomp.h
#PRECOMPILED_CXX = 1

Двоичные данные
release/SymCrypt_not_for_release_v86.1.cab Normal file

Двоичный файл не отображается.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

5968
release/inc/symcrypt.h Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,271 @@
//
// SymCrypt_inline.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Inline implementations for functions defined in symcrypt.h
//
///////////////////////////////////////////////////////////////
// Some functions and macros that we need for inlining code
///////////////////////////////////////////////////////////////
//
// SymCryptFatal
//
// Call the Fatal routine passed to the library upon initialization
//
_Analysis_noreturn_
VOID
SYMCRYPT_CALL
SymCryptFatal( UINT32 fatalCode );
//
// We use an ASSERT macro to catch problems in CHKed builds
// HARD_ASSERT checks also in FRE builds.
//
#define SYMCRYPT_HARD_ASSERT( _x ) \
{\
if( !(_x) ){ SymCryptFatal( 'asrt' ); }\
}\
_Analysis_assume_( _x )
#if defined( DBG )
#define SYMCRYPT_ASSERT( _x ) SYMCRYPT_HARD_ASSERT( _x )
#else
#define SYMCRYPT_ASSERT( _x ) \
_Analysis_assume_( _x )
#endif
//////////////////////////////////////////////////////////
//
// Environment macros
//
#ifdef __cplusplus
#define SYMCRYPT_EXTERN_C extern "C" {
#define SYMCRYPT_EXTERN_C_END }
#else
#define SYMCRYPT_EXTERN_C
#define SYMCRYPT_EXTERN_C_END
#endif
//
// Callers of SymCrypt should NOT depend on the function names in these macros.
// The definition of these macros can change in future releases of the library.
//
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_AMD64
typedef struct _SYMCRYPT_EXTENDED_SAVE_DATA SYMCRYPT_EXTENDED_SAVE_DATA, *PSYMCRYPT_EXTENDED_SAVE_DATA;
#define SYMCRYPT_ENVIRONMENT_DEFS_SAVEYMM( envName ) \
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSaveYmmEnv##envName( _Out_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ); \
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSaveYmm( _Out_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ) \
{ return SymCryptSaveYmmEnv##envName( pSaveArea ); } \
\
VOID SYMCRYPT_CALL SymCryptRestoreYmmEnv##envName( _Inout_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ); \
VOID SYMCRYPT_CALL SymCryptRestoreYmm( _Inout_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ) \
{ SymCryptRestoreYmmEnv##envName( pSaveArea ); } \
#define SYMCRYPT_ENVIRONMENT_DEFS_SAVEXMM( envName ) \
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSaveXmmEnv##envName( _Out_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ); \
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSaveXmm( _Out_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ) \
{ return SymCryptSaveXmmEnv##envName( pSaveArea ); } \
\
VOID SYMCRYPT_CALL SymCryptRestoreXmmEnv##envName( _Inout_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ); \
VOID SYMCRYPT_CALL SymCryptRestoreXmm( _Inout_ PSYMCRYPT_EXTENDED_SAVE_DATA pSaveArea ) \
{ SymCryptRestoreXmmEnv##envName( pSaveArea ); } \
#else
#define SYMCRYPT_ENVIRONMENT_DEFS_SAVEYMM( envName )
#define SYMCRYPT_ENVIRONMENT_DEFS_SAVEXMM( envName )
#endif
#define SYMCRYPT_ENVIRONMENT_DEFS( envName ) \
SYMCRYPT_EXTERN_C \
VOID SYMCRYPT_CALL SymCryptInitEnv##envName(); \
VOID SYMCRYPT_CALL SymCryptInit() \
{ SymCryptInitEnv##envName(); } \
\
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatalEnv##envName( UINT32 fatalCode ); \
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatal( UINT32 fatalCode ) \
{ SymCryptFatalEnv##envName( fatalCode ); } \
SYMCRYPT_CPU_FEATURES SYMCRYPT_CALL SymCryptCpuFeaturesNeverPresentEnv##envName(); \
SYMCRYPT_CPU_FEATURES SYMCRYPT_CALL SymCryptCpuFeaturesNeverPresent() \
{ return SymCryptCpuFeaturesNeverPresentEnv##envName(); } \
\
SYMCRYPT_ENVIRONMENT_DEFS_SAVEXMM( envName ) \
SYMCRYPT_ENVIRONMENT_DEFS_SAVEYMM( envName ) \
\
VOID SYMCRYPT_CALL SymCryptTestInjectErrorEnv##envName( PBYTE pbBuf, SIZE_T cbBuf ); \
VOID SYMCRYPT_CALL SymCryptInjectError( PBYTE pbBuf, SIZE_T cbBuf ) \
{ SymCryptTestInjectErrorEnv##envName( pbBuf, cbBuf ); } \
SYMCRYPT_EXTERN_C_END
//
// To avoid hard-do-diagnose mistakes, we skip defining environment macros in those cases where we
// know they cannot or should not be used.
//
#define SYMCRYPT_ENVIRONMENT_GENERIC SYMCRYPT_ENVIRONMENT_DEFS( Generic )
#if defined(EFI) | defined(PCAT) | defined(DIRECT)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_BOOTLIBRARY SYMCRYPT_ENVIRONMENT_DEFS( WindowsBootlibrary )
#endif
//
// There are no defined symbols that we can use to detect that we are in debugger code
// But this is unlikely to be misued.
//
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELDEBUGGER SYMCRYPT_ENVIRONMENT_DEFS( WindowsKernelDebugger )
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_LEGACY SYMCRYPT_ENVIRONMENT_GENERIC
#if (NTDDI_VERSION >= NTDDI_WIN7)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_WIN7_N_LATER SYMCRYPT_ENVIRONMENT_DEFS( WindowsKernelmodeWin7nLater )
#endif
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_WIN8_1_N_LATER SYMCRYPT_ENVIRONMENT_DEFS( WindowsKernelmodeWin8_1nLater )
#endif
#define SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_LATEST SYMCRYPT_ENVIRONMENT_WINDOWS_KERNELMODE_WIN8_1_N_LATER
#define SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_LEGACY SYMCRYPT_ENVIRONMENT_GENERIC
#if (NTDDI_VERSION >= NTDDI_WIN7)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_WIN7_N_LATER SYMCRYPT_ENVIRONMENT_DEFS( WindowsUsermodeWin7nLater )
#endif
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#define SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_WIN8_1_N_LATER SYMCRYPT_ENVIRONMENT_DEFS( WindowsUsermodeWin8_1nLater )
#endif
#define SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_LATEST SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_WIN8_1_N_LATER
//////////////////////////////////////////////////////////
//
// SymCryptWipe & SymCryptWipeKnownSize
//
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_AMD64 | SYMCRYPT_CPU_ARM | SYMCRYPT_CPU_ARM64
//
// If the known size is large we call the generic wipe function anyway.
// For small known sizes we perform the wipe inline.
// We put the limit at 8 native writes, which varies by platform.
//
//
#if SYMCRYPT_CPU_X86 | SYMCRYPT_CPU_ARM
#define SYMCRYPT_WIPE_FUNCTION_LIMIT (32) // If this is increased beyond 64 the code below must be updated.
#elif SYMCRYPT_CPU_AMD64 | SYMCRYPT_CPU_ARM64
#define SYMCRYPT_WIPE_FUNCTION_LIMIT (64) // If this is increased beyond 64 the code below must be updated.
#else
#error ??
#endif
//
// The buffer analysis code doesn't understand our optimized in-line wiping code
// well enough to conclude it is safe.
//
#pragma prefast(push)
#pragma prefast( disable: 26001 )
FORCEINLINE
VOID
SYMCRYPT_CALL
#pragma prefast( suppress: 6101, "Logic why this properly initializes the pbData buffer is too complicated for prefast" )
SymCryptWipeKnownSize( _Out_writes_bytes_( cbData ) PVOID pbData, SIZE_T cbData )
{
volatile BYTE * pb = (volatile BYTE *) pbData;
if( cbData > SYMCRYPT_WIPE_FUNCTION_LIMIT )
{
SymCryptWipe( pbData, cbData );
} else
{
//
// We assume that pb is aligned, so we wipe from the end to the front to keep alignment.
//
if( cbData & 1 )
{
cbData--;
SYMCRYPT_FORCE_WRITE8( (volatile BYTE *) &pb[cbData], 0 );
}
if( cbData & 2 )
{
cbData -= 2;
SYMCRYPT_FORCE_WRITE16( (volatile UINT16 *) &pb[cbData], 0 );
}
if( cbData & 4 )
{
cbData -= 4;
SYMCRYPT_FORCE_WRITE32( (volatile UINT32 *) &pb[cbData], 0 );
}
if( cbData & 8 )
{
cbData -= 8;
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData], 0 );
}
if( cbData & 16 )
{
cbData -= 16;
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData ], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 8], 0 );
}
if( cbData & 32 )
{
cbData -= 32;
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData ], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 8], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 16], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 24], 0 );
}
#if SYMCRYPT_WIPE_FUNCTION_LIMIT >= 64
if( cbData & 64 )
{
cbData -= 64;
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData ], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 8], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 16], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 24], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 32], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 40], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 48], 0 );
SYMCRYPT_FORCE_WRITE64( (volatile UINT64 *) &pb[cbData + 56], 0 );
}
#endif
}
}
#pragma prefast(pop)
#else // Platform switch for SymCryptWipeKnownSize
FORCEINLINE
VOID
SYMCRYPT_CALL
SymCryptWipeKnownSize( _Out_writes_bytes_( cbData ) PVOID pbData, SIZE_T cbData )
{
SymCryptWipe( pbData, cbData );
}
#endif // Platform switch for SymCryptWipeKnownSize

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,86 @@
//
// SymCrypt_types.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Datatypes used by the SymCrypt library. This ensures compatibility
// with multiple environments, such as Windows, iOS, and Android.
//
#ifdef WIN32
//
// Types included in intsafe.h:
// BYTE,
// INT16, UINT16,
// INT32, UINT32,
// INT64, UINT64,
// UINT_PTR
// and macro:
// UINT32_MAX
//
#include <intsafe.h>
#else
#include <stdint.h>
typedef uint8_t BYTE;
typedef int16_t INT16;
typedef uint16_t UINT16;
typedef int32_t INT32;
typedef uint32_t UINT32;
typedef int64_t INT64;
typedef uint64_t UINT64;
typedef uintptr_t UINT_PTR;
#ifndef UINT32_MAX
#define UINT32_MAX (0xffffffff)
#endif
// Boolean
typedef BYTE BOOLEAN;
#ifndef TRUE
#define TRUE 0x01
#endif
#ifndef FALSE
#define FALSE 0x00
#endif
// Size_t
typedef size_t SIZE_T;
#endif //WIN32
//
// Pointer types
//
typedef BYTE * PBYTE;
typedef const BYTE * PCBYTE;
typedef UINT16 * PUINT16;
typedef const UINT16 * PCUINT16;
typedef UINT32 * PUINT32;
typedef const UINT32 * PCUINT32;
typedef UINT64 * PUINT64;
typedef const UINT64 * PCUINT64;
// Void
#ifndef VOID
#define VOID void
#endif
typedef void * PVOID;
typedef const void * PCVOID;

Просмотреть файл

@ -0,0 +1,41 @@
;/*
; SymCrypt_version.inc
; Copyright (c) Microsoft Corporation. All rights reserved.
;
; This is the file that contains the SymCrypt version information. It is updated by the build system
; so that each version of the library has a unique version number.
;
; THIS FILE IS INCLUDED BOTH IN C AND ASSEMBLER CODE
; which is why the layout is strange.
; The first line is ";/_*" (without the _)
; which is an assembler comment, and the start of a C comment.
; (In C an extra semicolon is allowed.)
; (The extra _ is added above to not break compilers who violate the C standard and
; allow nested slash-star comments.)
; Below we have separate areas where the C and ASM version numbers are defined.
; These should always be the same.
;
; The API version is intended to change when we change the API behavior in a way that
; breaks backward compatibility. Currently this value is not used.
;
; The release version is incremented for every 'release' build.
; For private builds between releases the private version number is incremented.
;
SYMCRYPT_API_VERSION EQU 1
SYMCRYPT_CODE_VERSION_RELEASE EQU 86
SYMCRYPT_CODE_VERSION_PRIVATE EQU 0
if 0 ; Start an area that the assembler ignores
;*/ // End of C comment, the C compiler will read the lines below
#define SYMCRYPT_API_VERSION 1
#define SYMCRYPT_CODE_VERSION_RELEASE 86
#define SYMCRYPT_CODE_VERSION_PRIVATE 0
;/* ; Switch back into a C comment so that we can close the IF
endif
;*/

Двоичные данные
release/lib/amd64chk/symcrypt.lib Normal file

Двоичный файл не отображается.

Двоичные данные
release/lib/amd64chk/symcryptunittest.exe Normal file

Двоичный файл не отображается.

Двоичные данные
release/lib/amd64chk/symcryptunittest.pdb Normal file

Двоичный файл не отображается.

Двоичные данные
release/lib/amd64chk/symcryptunittest_legacy.exe Normal file

Двоичный файл не отображается.

Двоичные данные
release/lib/amd64chk/symcryptunittest_legacy.pdb Normal file

Двоичный файл не отображается.

Двоичные данные
release/lib/amd64chk/symcryptunittest_win7nlater.exe Normal file

Двоичный файл не отображается.

Двоичные данные
release/lib/amd64chk/symcryptunittest_win7nlater.pdb Normal file

Двоичный файл не отображается.

Двоичные данные
release/lib/amd64chk/symcryptunittest_win8_1nlater.exe Normal file

Двоичный файл не отображается.

Двоичные данные
release/lib/amd64chk/symcryptunittest_win8_1nlater.pdb Normal file

Двоичный файл не отображается.

1010
release/scbuild.log Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

45
scbuild.cmd Normal file
Просмотреть файл

@ -0,0 +1,45 @@
rem
rem First stage of SymCrypt build process
rem Copyright (c) Microsoft Corporation. All rights reserved.
rem
rem @echo off
cd scbuild
call build -c -z
cd ..
rem Currently the build errors because of OACR issues
if ERRORLEVEL 1 goto :BuildError
rem We make a copy of the binary so that the later build can remove the binary in the OBJ dir.
rem
rem We have to construct the directory name where teh resulting binary can be found
rem
if /I "%_BuildArch%" == "x86" (
set ScBuildTmp=i386
) ELSE (
set ScBuildTmp=%_BuildArch%
)
rem
rem We delete the temp copy to ensure we never run an old version.
rem (The copy might fail if the exe directory changes for some reason.)
rem
del %TEMP%\scbuild.exe 2>nul
copy %OBJECT_ROOT%\symcrypt\scbuild\obj%_BuildType%\%ScBuildTmp%\scbuild.exe %TEMP%\scbuild.exe
set ScBuildTmp=
echo on
%TEMP%\scbuild.exe %*
@echo off
del %TEMP%\scbuild.exe
@goto :EOF
:BuildError
rem cd ..
echo Error in build, aborting scbuild.cmd script...
goto :EOF

991
scbuild/scbuild.cs Normal file
Просмотреть файл

@ -0,0 +1,991 @@
//
// ScBuild.cs
// SymCrypt build tool
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
using System;
using System.IO;
using System.Collections;
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace ScBuild{
static public class Output
{
public static int OutputIndent = 0;
public static ArrayList AllOutput = new ArrayList();
public static void Print( params object[] args)
{
string s;
if( args.Length == 1 )
{
s = (string) args[0];
} else
{
object [] t = new object[ args.Length - 1 ];
Array.Copy( args, 1, t, 0, args.Length - 1 );
s = String.Format( (string)args[0], t );
}
if( outputFile != null )
{
outputFile.Write( s.Replace( "\n", outputFile.NewLine ) );
}
System.Console.Write( s );
AllOutput.Add( s );
}
public static void OpenLogFile( string filename )
{
outputFile = File.CreateText( filename );
}
public static void CloseLogFile()
{
if( outputFile != null )
{
outputFile.Close();
outputFile = null;
}
}
static StreamWriter outputFile = null;
}
public class FatalException: Exception
{
public FatalException( string m ) : base( m ) {}
}
class ScBuild
{
string LogDateTimeFormat = "yyyy-MM-dd HH:mm:ss.ff";
public IDictionary m_environment;
public string m_SymCryptDir;
public static void Print( params object[] args )
{
Output.Print( args );
}
public static void Fatal( params object[] args )
{
object [] t = new object[ args.Length - 1 ];
Array.Copy( args, 1, t, 0, args.Length - 1 );
string s = String.Format( (string)args[0], t );
Print( "*\n\n" );
throw new FatalException( "\n" + s );
}
//
// Helper functions for running other programs
//
public string[] Run( string ExeName, string Arguments )
{
Print( "> " + ExeName + " " + Arguments + "\n" );
RunStdout.Clear();
RunStderr.Clear();
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = ExeName;
p.StartInfo.Arguments = Arguments;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false; // Needed for stdout/stderr redirection
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.OutputDataReceived += new DataReceivedEventHandler( StdOutDataHandler );
p.ErrorDataReceived += new DataReceivedEventHandler( StdErrDataHandler );
p.Start();
p.BeginOutputReadLine();
p.BeginErrorReadLine();
p.WaitForExit();
//
// Should improve this: strip trailing empty lines from both of the outputs
//
string [] s = new string[RunStdout.Count + RunStderr.Count ];
for( int i=0; i<RunStdout.Count; i++ )
{
s[i] = (string) RunStdout[i];
}
for( int i=0; i<RunStderr.Count; i++ )
{
s[i + RunStdout.Count] = (string) RunStderr[i];
}
return s;
}
public static void StdOutDataHandler( object sendingProcess, DataReceivedEventArgs OutLine )
{
if( !String.IsNullOrEmpty( OutLine.Data ) )
{
string s = " " + OutLine.Data;
//Print( "Stdout output: " + s );
RunStdout.Add( s);
Print( s + "\n" );
}
}
public static void StdErrDataHandler( object sendingProcess, DataReceivedEventArgs OutLine )
{
if( !String.IsNullOrEmpty( OutLine.Data ) )
{
string s = "* " + OutLine.Data;
//Print( "Stderr output: " + s );
RunStderr.Add( s );
Print( s + "\n" );
}
}
public string[] RunCmd( string relDir, string CommandLine )
{
Print( relDir + "> " + CommandLine + "\n" );
string exeName = m_environment[ "windir" ] + @"\system32\cmd.exe" ;
string args = CommandLine;
if( relDir.Length != 0 )
{
args = "cd " + relDir + " && " + args;
}
args = String.Format( "/c \"{0}\"", args );
return Run( exeName, args );
}
public void MoveFile( string src, string dst )
{
string [] res = RunCmd( "", "move " + src + " " + dst );
if( res.Length != 1 || !Regex.IsMatch( res[0], @"\s+1\s+file\(s\) moved." ) )
{
foreach( string pat in new string [] {
@".*",
@"\s+1.*",
@"\s+1\s+",
@"\s+1\s+file",
@"\s+1\s+file(s)",
@"\s+1\s+file(s) moved",
@"\s+1\s+file(s) moved.",
} )
{
Print( "[{0}] {1} \n", pat, Regex.IsMatch( res[0], pat ) );
}
Fatal( "Unexpected response from file move {0} [{1}]", res.Length, res[0] );
}
}
public void CopyFile( string src, string dst )
{
string [] res = RunCmd( "", "copy " + src + " " + dst );
if( res.Length != 1 || !Regex.IsMatch( res[0], @"\s+1\s+file\(s\) copied." ) )
{
Fatal( "Unexpected response from file copy (lines ={0} [{1}])", res.Length, res[0] );
}
}
static string[] m_banned_symbols = new string[] {
// Split each symbol so that we don't match against this source file...
"_" + "KERNEL_MODE", // all our code is compiled with the /kernel flag which sets this symbol, but that doesn't mean we run in kernel mode
};
public void CheckForBannedSymbols()
{
foreach( string sym in m_banned_symbols ){
string [] res = RunCmd( "", "findstr -spr \"\\<" + sym + "\\>\" *.c *.h *.cs *.cpp" );
if( res.Length != 0 )
{
Fatal( "Found banned symbol \"{0}\"", sym );
}
}
}
int m_nBuildError = 0;
public void Build( string subDir, string arch )
{
string[] res = RunCmd(subDir, "razzle " +arch + " no_oacr exec build -c -z");
bool buildError = false;
int nResultLines = 0;
foreach( string line in res )
{
if( String.IsNullOrEmpty( line.Trim() ) )
{
continue;
}
Match match = Regex.Match( line, @"\s+\d+\s+(files? compiled|librar(y|ies) built|files? binplaced|executables? built)(?<error>.*)$" );
if( match.Success )
{
nResultLines++;
//Print( "***[{0}]\n", line );
string possibleError = match.Groups[ "error" ].Value;
//Print( "***+{0}+\n", possibleError );
if( possibleError.Length > 0 )
{
if( !Regex.IsMatch( possibleError, @"\s+\-\s+\d+\s+Error" ) )
{
Fatal( "Could not parse possible error string '{0}' in line '{1}'", possibleError, line );
}
buildError = true;
}
}
else
{
if( nResultLines > 0 )
{
Fatal( "Found non-result lines after a line that I interpreted as part of the final result: {0}", line );
}
}
}
if( buildError )
{
m_nBuildError++;
Fatal( "ERROR: detected build error while building {0}\n", arch );
} else if( nResultLines == 0 )
{
Fatal( "Could not validate success of build" );
}
//
// Move the log file over to the release directory
//
string subDirNamePart = "";
string subDirPath = "";
if( subDir != "" )
{
subDirNamePart = subDir + @"_";
subDirPath = subDir + @"\";
}
string chkfre = arch.Substring( arch.Length - 3, 3 );
string LogFileName = subDirPath + "build" + chkfre + ".log";
string DestFileName = @"release\buildlogs\" + subDirNamePart + "build" + arch + ".log";
MoveFile( LogFileName, DestFileName );
}
public void CheckWindowsRazzleEnvironment()
{
Print( "Checking that we run in a Windows Razzle environment... " );
string [] requiredVariables = new string[] {
"PUBLIC_ROOT",
"SDXROOT",
"_NTROOT",
"_NTDRIVE",
};
foreach( string s in requiredVariables )
{
if( !m_environment.Contains( s ) )
{
Fatal( "Could not find environment variable '{0}' which is expected in a Windows enlistment", s );
}
}
Print( "Ok\n" );
}
public void CheckFilePresent( string filename )
{
if( !File.Exists( filename ) )
{
Fatal( "Could not find file '{0}'", filename );
}
}
public void CheckSymCryptEnlistmentPresent()
{
Print( "Checking for presence of symcrypt enlistment in windows enlistment... " );
m_SymCryptDir = m_environment[ "_NTDRIVE"] + (m_environment[ "_NTROOT" ] + @"\symcrypt");
string currentDir = Directory.GetCurrentDirectory();
if( String.Compare( m_SymCryptDir, currentDir, true ) != 0 )
{
Fatal( "ScBuild is not being run from the SymCrypt directory. \n" +
"Current directory = {0}\n" +
"Expected = {1}\n",
currentDir, m_SymCryptDir );
}
CheckFilePresent( @"inc\symcrypt_version.inc" );
CheckFilePresent( @"inc\symcrypt.h" );
CheckFilePresent( @"lib\sc_lib.h" );
Print( "Ok\n" );
}
public static IList RunStdout = ArrayList.Synchronized( new ArrayList() );
public static IList RunStderr = ArrayList.Synchronized( new ArrayList() );
public void CheckRelDirSynced( string relDir )
{
string [] res = RunCmd( relDir, "git status ." );
bool unSync = false;
bool Sync = false;
foreach( string resLine in res )
{
if( Regex.IsMatch( resLine, @"nothing to commit, working tree clean" ) )
{
Sync = true;
}
else if( Regex.IsMatch( resLine, @"untracked files present" ) ||
Regex.IsMatch( resLine, @"Changes to be committed" ) )
{
unSync = true;
}
}
if( unSync )
{
if( m_option_ignore_sync )
{
Print( "...ignoring directory '{0}' not in sync\n", relDir );
}
else
{
Fatal( "Directory '{0}' is not in sync", relDir );
}
}
if( !Sync )
{
if( m_option_ignore_sync )
{
// No point in printing another warning if we already did one.
if( !unSync )
{
Print( "...ignoring directory '{0}' not validated as sync'd\n", relDir );
}
}
else
{
Fatal( "Could not validate/recognize that directory '{0}' is in sync", relDir );
}
}
}
void CheckToolsSynced()
{
// Removed this check as it does not work on Git enlistments.
// We could write code to make this check on Git, but
// in Git, the working directory is easily up-to-date with the branch, so this
// check is not very useful.
// The real problem is that the working branch might be out of date with the 'main' branch.
// Unfortunately, there is no way to know what the 'main' branch is, so
// there is no way to automate this check.
// Users will have to merge the main branch into the working branch before running scbuild.
// CheckRelDirSynced( @"..\..\tools" );
}
void CheckSymCryptSynced()
{
CheckRelDirSynced( "." );
}
void CheckWriteableFiles()
{
string [] res = RunCmd( "", "dir /a-r-d /s /b" );
foreach( string r in res )
{
string Line = r.ToLower();
int i = Line.LastIndexOf( '\\' );
if( i < 0 )
{
Fatal( "Did not find path separator in DIR output" );
}
string FileName = Line.Substring( i+1, Line.Length - i - 1 );
if(
!Line.Contains( @"symcrypt\release" ) &&
FileName != "buildchk.log" &&
FileName != "buildchk.err" &&
FileName != "buildfre.log" &&
FileName != "buildfre.err" &&
FileName != "buildchk.trc" &&
FileName != "buildfre.trc" &&
FileName != "buildchk.prf" &&
FileName != "buildfre.prf" &&
FileName != "buildchk.wrn" &&
FileName != "buildfre.wrn" &&
FileName != "buildchk.dbb" &&
FileName != "buildfre.dbb" &&
FileName != "buildchk.evt" &&
FileName != "buildfre.evt" &&
FileName != "buildchk.metadata" &&
FileName != "buildfre.metadata" &&
FileName != "scbuild.log"
)
{
if( m_option_ignore_writable )
{
Print( "...ignoring writable file {0}\n", Line );
} else
{
Fatal( "Unknown writable file '{0}' found", Line );
}
}
}
}
int m_releaseVersion = -1;
int m_privateVersion = -1;
void UpdateVersionNumber()
{
string versionFileName = @"inc\symcrypt_version.inc";
string [] lines = File.ReadAllLines( versionFileName );
if( lines.Length < 10 )
{
Fatal( "Could not read file '{0}'", versionFileName );
}
int vRelease = -1;
int nRelease = 0;
int vPrivate = -1;
int nPrivate = 0;
int newRelease = -1;
int newPrivate = -1;
for( int i=0; i<lines.Length; i++ )
{
string line = lines[i];
if( line.Contains( "SYMCRYPT_CODE_VERSION_RELEASE" ) )
{
MatchCollection matches = Regex.Matches( line, @"\d+" );
if( matches.Count != 1 )
{
Fatal( "Did not find a single integer in a Release version line '{0}'", line );
}
Match m = matches[0];
string digits = m.Value;
int releaseVersion = Convert.ToInt32( digits );
if( vRelease >= 0 && vRelease != releaseVersion )
{
Fatal( "Inconsistent release versions in symcrypt_version.inc file {0} {1} {2}", vRelease, releaseVersion, line );
}
vRelease = releaseVersion;
newRelease = vRelease;
if( m_option_release )
{
newRelease++;
line = line.Replace( digits, newRelease.ToString() );
lines[i] = line;
}
nRelease++;
}
if( line.Contains( "SYMCRYPT_CODE_VERSION_PRIVATE" ) )
{
MatchCollection matches = Regex.Matches( line, @"\d+" );
if( matches.Count != 1 )
{
Fatal( "Did not find a single integer in a Private version line '{0}'", line );
}
Match m = matches[0];
string digits = m.Value;
int privateVersion = Convert.ToInt32( digits );
if( vPrivate >= 0 && vPrivate != privateVersion )
{
Fatal( "Inconsistent private versions in symcrypt_version.inc file" );
}
vPrivate = privateVersion;
newPrivate = vPrivate + 1;
if( m_option_release )
{
newPrivate = 0;
}
line = line.Replace( digits, newPrivate.ToString() );
lines[i] = line;
nPrivate++;
}
}
if( nPrivate != 2 || nRelease != 2 )
{
Fatal( "symcrypt_version.inc file has unexepected number of release or private version-containing lines" );
}
foreach( string l in lines )
{
//Print( l + "\n" );
}
m_releaseVersion = newRelease;
m_privateVersion = newPrivate;
Print( "New SymCrypt version number: Release = {0}, Private = {1}\n", newRelease, newPrivate );
if( m_option_version_noupdate )
{
Print( "...Not updating version number\n" );
return;
}
File.WriteAllLines(versionFileName, lines);
string[] res = RunCmd( "", "git commit -m \"Updating symcrypt_version.inc\" " + versionFileName );
bool foundChange = false;
bool foundCreate = false;
foreach( string line in res )
{
if (Regex.IsMatch(line, @"1 file changed"))
{
foundChange = true;
}
if( Regex.IsMatch( line, @"create mode" ) )
{
foundCreate = true;
}
}
if( !foundChange | !foundCreate )
{
Fatal( @"Cound not commit file '{0}'", versionFileName );
}
}
public void CopySymCryptToRelaseDir( string arch )
{
// We have to construct our own object_root as the copy command runs in the environment
// of the razzle that called scbuild, not the razzle that builds the flavour.
// string object_root = "" + m_environment["_NTBINDRIVE"] + m_environment[ "_NTROOT" ] + ".obj." + arch;
string object_root = "" + m_environment["OSBuildRoot"] + @"\obj\" + arch;
string libFileName = object_root + @"\symcrypt\lib\" + objDirName( arch ) + "symcrypt.lib";
CopyFile( libFileName, @"release\lib\" + arch + @"\symcrypt.lib" );
string testFileName = object_root + @"\symcrypt\unittest\exe_test\" + objDirName(arch) + "symcryptunittest";
CopyFile(testFileName + ".exe", @"release\lib\" + arch + @"\symcryptunittest.exe");
CopyFile(testFileName + ".pdb", @"release\lib\" + arch + @"\symcryptunittest.pdb");
string testFileName2 = object_root + @"\symcrypt\unittest\exe_win7nlater\" + objDirName(arch) + "symcryptunittest_win7nlater";
CopyFile(testFileName2 + ".exe", @"release\lib\" + arch + @"\symcryptunittest_win7nlater.exe");
CopyFile(testFileName2 + ".pdb", @"release\lib\" + arch + @"\symcryptunittest_win7nlater.pdb");
string testFileName4 = object_root + @"\symcrypt\unittest\exe_win8_1nlater\" + objDirName(arch) + "symcryptunittest_win8_1nlater";
CopyFile(testFileName4 + ".exe", @"release\lib\" + arch + @"\symcryptunittest_win8_1nlater.exe");
CopyFile(testFileName4 + ".pdb", @"release\lib\" + arch + @"\symcryptunittest_win8_1nlater.pdb");
string testFileName3 = object_root + @"\symcrypt\unittest\exe_legacy\" + objDirName(arch) + "symcryptunittest_legacy";
CopyFile(testFileName3 + ".exe", @"release\lib\" + arch + @"\symcryptunittest_legacy.exe");
CopyFile(testFileName3 + ".pdb", @"release\lib\" + arch + @"\symcryptunittest_legacy.pdb");
}
public string objDirName( string arch )
{
string cpu = arch.Substring( 0, arch.Length - 3 );
string cpudir = (cpu != "x86") ? cpu : "i386";
string chkfre = arch.Substring( arch.Length - 3, 3 );
return "obj" + chkfre + @"\" + cpudir + @"\";
}
public void RunSymCryptTest( string arch )
{
// string object_root = m_environment[ "BASEDIR" ] + ".obj." + arch;
string object_root = "" + m_environment["OSBuildRoot"] + @"\obj\" + arch;
string cpu = arch.Substring( 0, arch.Length - 3 );
string cpudir = (cpu != "x86") ? cpu : "i386";
if( arch.StartsWith( "x86" ) || arch.StartsWith( "amd64" ) )
{
string [] res = RunCmd( "", @"release\lib\" + arch + @"\" + @"symcryptunittest -savexmmnofail" );
if( !Regex.IsMatch( res[ res.Length - 1 ], "...SymCrypt unit test done" ) )
{
Fatal( "Did not detect that SymCrypt unit test succeeded" );
}
}
}
public void BuildAndUnitTest()
{
string [] flavors = m_option_flavors;
if( flavors == null )
{
flavors = m_all_flavors;
}
foreach( string flavor in flavors )
{
Build( "", flavor );
CopySymCryptToRelaseDir( flavor );
}
if( m_nBuildError > 0 )
{
Fatal( "One or more build errors occurred" );
}
foreach( string flavor in flavors )
{
RunSymCryptTest( flavor );
}
}
bool m_option_release = false;
bool m_option_private = false;
bool m_option_test = false;
string [] m_option_flavors = null;
static string [] m_all_flavors = new string [] {
"amd64chk",
// "x86chk", "x86fre",
// "amd64chk", "amd64fre",
// "armchk", "armfre",
// "arm64chk", "arm64fre",
};
bool m_option_ignore_sync = false;
bool m_option_ignore_writable = false;
bool m_option_ignore_opened = false;
bool m_option_version_noupdate = false;
bool m_option_no_tag = false;
string m_argumentsString = "";
public bool ProcessOptions( string [] args )
{
for( int i=0; i<args.Length; i++ )
{
string opt = args[i].ToLower();
m_argumentsString = m_argumentsString + " " + opt;
if (opt == "-r")
{
m_option_release = true;
}
else if (opt == "-p")
{
m_option_private = true;
}
else if (opt == "-t")
{
m_option_test = true;
ProcessOptions(new string[] { "-i", });
m_option_version_noupdate = true;
m_option_no_tag = true;
}
else if (opt.StartsWith("-i"))
{
if (opt.Length == 2)
{
ProcessOptions(new string[] { "-iswo", });
}
else
{
for (int j = 2; j < opt.Length; j++)
{
switch (opt[j])
{
case 's': m_option_ignore_sync = true; break;
case 'w': m_option_ignore_writable = true; break;
case 'o': m_option_ignore_opened = true; break;
default: Fatal("Unknown ignore letter {0} in option {1}", opt[j], opt); break;
}
}
}
}
else if (opt.StartsWith("-f"))
{
string[] fls = opt.Substring(2, opt.Length - 2).Split(new Char[] { ',' });
foreach (string fl in fls)
{
if (Array.IndexOf(m_all_flavors, fl) < 0)
{
Fatal("Unrecognized flavor '{0}' in option '{1}'", fl, opt);
}
}
m_option_flavors = fls;
}
else
{
Usage();
return false;
}
}
return true;
}
int BoolToInt(bool b)
{
if (b)
{
return 1;
}
return 0;
}
public void CheckOptionConsistency()
{
if (BoolToInt(m_option_release) + BoolToInt(m_option_private) + BoolToInt(m_option_test) == 0)
{
ProcessOptions( new string [] {"-t"} );
}
if (BoolToInt(m_option_release) + BoolToInt(m_option_private) + BoolToInt(m_option_test) != 1)
{
Fatal("Cannot specify more than one of -r -p -t");
}
}
public void Usage()
{
Print( "Usage: scbuild <options...>\n"
+ "Options:\n"
+ "-r Build a release version (increments release version number)\n"
+ "-p Build a private version (increments private version number)\n"
+ "-t Build a test version (no changes to git repo)\n"
+ "-i[swo] Ignore Sync/Writable/Opened file issues\n"
+ " -i is equivalent to -iswo\n"
+ "-f<...> Specify flavors to build in comma-separated list\n"
+ " Flavors: x86chk, x86fre, amd64chk, amd64fre, armchk, armfre,\n"
+ " arm64chk, arm64fre\n"
);
}
public void CreateGitTag()
{
// Our code still used 'label' in many places, as that is the tag conceptin Source Depot
if( !m_option_release || m_option_no_tag )
{
return;
}
if( m_option_ignore_opened || m_option_ignore_sync || m_option_ignore_writable || m_option_version_noupdate )
{
Print( "Label creation disabled while any -i option is used\n" );
return;
}
if( m_releaseVersion < 0 || m_privateVersion < 0 )
{
Fatal( "Invalid version number found when trying to create Git tag for release" );
}
string labelNumber = "" + m_releaseVersion + "." + m_privateVersion;
string labelName = "SymCrypt_v" + labelNumber;
string [] res;
res = RunCmd( "", "git tag -a -m \"Release of " + labelName + "\" " + labelName );
if( res.Length != 0 )
{
Fatal("Unexpected output from tag command");
}
res = RunCmd("", "git tag -l " + labelName);
if( res.Length != 1 || !Regex.IsMatch( res[0], labelName) )
{
Fatal("Could not verify that tag was properly created");
}
}
public void CreateCab()
{
Print("Copying header files to release directory...\n");
string[] filesToCopy = new string[] {
@"symcrypt.h",
@"symcrypt_low_level.h",
@"symcrypt_inline.h",
@"symcrypt_internal.h",
@"symcrypt_types.h",
@"symcrypt_version.inc",
};
foreach (string file in filesToCopy)
{
CopyFile(@"inc\" + file, @"release\inc\" + file);
}
Print( "Closing log file and creating CAB...\n" );
Print( "Current time = {0}\n", DateTime.Now.ToString( LogDateTimeFormat ) );
Output.CloseLogFile();
MoveFile( "scbuild.log", @"release\scbuild.log" );
if( m_releaseVersion < 0 || m_privateVersion < 0 )
{
Fatal( "Cannot generate CAB file without version number {0} {1}", m_releaseVersion, m_privateVersion );
}
string fileNameWarning = "";
if( m_option_flavors != null ||
m_option_ignore_opened ||
m_option_ignore_sync ||
m_option_ignore_writable ||
m_option_no_tag ||
m_option_version_noupdate ||
!m_option_release
)
{
fileNameWarning = "_not_for_release";
}
string cabFileName = "SymCrypt" + fileNameWarning + "_v" + m_releaseVersion + "." + m_privateVersion + ".cab";
string [] res = RunCmd( "release", "cabarc -r -p n " + cabFileName + " *.*" );
if( !Regex.IsMatch( res[ res.Length - 1 ], "Completed successfully" ) )
{
Fatal( "Could not validate success of cab creation" );
}
}
public void CleanReleaseDirectory()
{
string [] res = RunCmd( "", @"rmdir ..\symcrypt\release /s /q" );
if( res.Length != 0 )
{
if( res.Length != 1 || res[0] != "* The system cannot find the file specified." )
{
Fatal( "Unexpected output from the rmdir command: " + res[0] );
}
}
string [] directoriesToCreate = new string[] {
@"release",
@"release\buildlogs",
@"release\lib\amd64chk",
@"release\lib\amd64fre",
@"release\lib\x86chk",
@"release\lib\x86fre",
@"release\lib\armchk",
@"release\lib\armfre",
@"release\lib\arm64chk",
@"release\lib\arm64fre",
@"release\inc",
};
foreach( string dir in directoriesToCreate )
{
res = RunCmd( "", "mkdir " + dir );
if( res.Length != 0 )
{
Fatal( "Unexpected output from mkdir command" );
}
}
}
public ScBuild( string [] args )
{
m_environment = System.Environment.GetEnvironmentVariables();
Output.OpenLogFile( "ScBuild.log" );
Print( "> ScBuild" );
foreach( string arg in args )
{
Print( " {0}", arg );
}
Print( "\n" );
Print( "SymCrypt build tool version 1.0\n");
Print( "Start time = {0}\n", DateTime.Now.ToString( LogDateTimeFormat ) );
if( !ProcessOptions( args ) )
{
return;
}
CheckOptionConsistency();
CheckWindowsRazzleEnvironment();
CheckSymCryptEnlistmentPresent();
CheckToolsSynced();
CheckSymCryptSynced();
// In Git, all files are writable, so this check is not useful.
// CheckWriteableFiles();
CheckForBannedSymbols();
UpdateVersionNumber();
CleanReleaseDirectory();
CreateGitTag();
BuildAndUnitTest();
CreateCab();
}
public static int Main( string[] args )
{
int res = 0;
try
{
new ScBuild( args );
} catch( Exception e )
{
Print( "FATAL ERROR: {0}\n", e );
res = -1;
}
Output.CloseLogFile();
return res;
}
}
}

26
scbuild/sources Normal file
Просмотреть файл

@ -0,0 +1,26 @@
TARGETNAME=ScBuild
TARGETTYPE=PROGRAM
MANAGED_CODE = 1
URT_VER=4.6
UMTYPE = console
SOURCES = \
scbuild.cs
NTDDI_VERSION=$(LATEST_NTDDI_VERSION)
#
# The code must be signed to be useable.
# Only test code is signed during a normal build, so we mark this as test code
#
TEST_CODE = 1
NT_SIGNCODE = 1
REFERENCES =\
$(CLR_REF_PATH)\System.metadata_dll; \

14
unittest/dirs Normal file
Просмотреть файл

@ -0,0 +1,14 @@
DIRS = \
lib \
exe_test \
exe_Win7nLater \
exe_Win8_1nLater \
exe_legacy \
sys_test \
sys_Win7nLater \
sys_legacy \

Просмотреть файл

@ -0,0 +1,59 @@
//
// Main_test.cpp
// Main file for SymCrypt unit test program
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "precomp.h"
#include "rsa32_implementations.h"
#include "capi_implementations.h"
#include "cng_implementations.h"
#include "sc_implementations.h"
#include "ref_implementations.h"
SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_WIN7_N_LATER;
char * g_implementationNames[] =
{
ImpSc::name,
ImpRsa32::name,
ImpRsa32b::name,
ImpCapi::name,
ImpCng::name,
ImpRef::name,
NULL,
};
#include "main_exe_common.cpp"
int __cdecl
main( int argc, _In_reads_( argc ) char * argv[] )
{
initTestInfrastructure( argc, argv );
addCapiAlgs();
addRsa32Algs();
addCngAlgs();
addSymCryptAlgs();
addRefAlgs();
if (g_profile)
{
runProfiling();
}
else
{
runFunctionalTests();
testMultiThread();
runPerfTests();
}
exitTestInfrastructure();
return 0;
}

Просмотреть файл

@ -0,0 +1,7 @@
//
// precomp.h Precompiled header file for SymCrypt unit test
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "test_lib.h"

Просмотреть файл

@ -0,0 +1,6 @@
TARGETNAME=symcryptunittest_Win7nLater
C_DEFINES=$(C_DEFINES) -DTESTDRIVER_NAME=\"SymCryptDriver_win7nlater.sys\"
!include ..\sources_exe.inc
_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WIN7)

Просмотреть файл

@ -0,0 +1,5 @@
//
// Copyright (c) Microsoft Corp, all rigts reserved.
//
#include "..\symcryptunittest.rc"

Просмотреть файл

@ -0,0 +1,65 @@
//
// Main_test.cpp
// Main file for SymCrypt unit test program
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "precomp.h"
#include "rsa32_implementations.h"
#include "capi_implementations.h"
#include "cng_implementations.h"
#include "sc_implementations.h"
#include "ref_implementations.h"
SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_WIN8_1_N_LATER;
char * g_implementationNames[] =
{
ImpSc::name,
ImpRsa32::name,
ImpRsa32b::name,
ImpCapi::name,
ImpCng::name,
ImpRef::name,
NULL,
};
#include "main_exe_common.cpp"
int __cdecl
main( int argc, _In_reads_( argc ) char * argv[] )
{
initTestInfrastructure( argc, argv );
// SGX mode cares about testing BCrypt functions in enclaves, so ignores CAPI and RSA32 tests
// which are identical to normal mode. SymCrypt provides implementations for all algs,
// so they must run because the test fails if there are algorithms where no implementations were tested.
if (!g_sgx)
{
addCapiAlgs();
addRsa32Algs();
}
addCngAlgs();
addSymCryptAlgs();
addRefAlgs();
if (g_profile)
{
runProfiling();
}
else
{
runFunctionalTests();
testMultiThread();
runPerfTests();
}
exitTestInfrastructure();
return 0;
}

Просмотреть файл

@ -0,0 +1,7 @@
//
// precomp.h Precompiled header file for SymCrypt unit test
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "test_lib.h"

Просмотреть файл

@ -0,0 +1,7 @@
TARGETNAME=symcryptunittest_Win8_1nLater
# TODO: update this to a Win8.1 test driver
C_DEFINES=$(C_DEFINES) -DTESTDRIVER_NAME=\"SymCryptDriver_win7nlater.sys\"
!include ..\sources_exe.inc
_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINBLUE)

Просмотреть файл

@ -0,0 +1,5 @@
//
// Copyright (c) Microsoft Corp, all rigts reserved.
//
#include "..\symcryptunittest.rc"

Просмотреть файл

@ -0,0 +1,59 @@
//
// Main_test.cpp
// Main file for SymCrypt unit test program
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "precomp.h"
#include "rsa32_implementations.h"
#include "capi_implementations.h"
#include "cng_implementations.h"
#include "sc_implementations.h"
#include "ref_implementations.h"
SYMCRYPT_ENVIRONMENT_WINDOWS_USERMODE_LEGACY;
char * g_implementationNames[] =
{
ImpSc::name,
ImpRsa32::name,
ImpRsa32b::name,
ImpCapi::name,
ImpCng::name,
ImpRef::name,
NULL,
};
#include "main_exe_common.cpp"
int __cdecl
main( int argc, _In_reads_( argc ) char * argv[] )
{
initTestInfrastructure( argc, argv );
addCapiAlgs();
addRsa32Algs();
addCngAlgs();
addSymCryptAlgs();
addRefAlgs();
if (g_profile)
{
runProfiling();
}
else
{
runFunctionalTests();
testMultiThread();
runPerfTests();
}
exitTestInfrastructure();
return 0;
}

Просмотреть файл

@ -0,0 +1,7 @@
//
// precomp.h Precompiled header file for SymCrypt unit test
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "test_lib.h"

Просмотреть файл

@ -0,0 +1,8 @@
TARGETNAME=symcryptunittest_legacy
C_DEFINES=$(C_DEFINES) -DTESTDRIVER_NAME=\"SymCryptDriver_legacy.sys\"
!include ..\sources_exe.inc
_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_VISTA)

Просмотреть файл

@ -0,0 +1,5 @@
//
// Copyright (c) Microsoft Corp, all rigts reserved.
//
#include "..\symcryptunittest.rc"

Просмотреть файл

@ -0,0 +1,73 @@
//
// Main_test.cpp
// Main file for SymCrypt unit test program
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "precomp.h"
#include "msbignum_implementations.h"
#include "rsa32_implementations.h"
#include "capi_implementations.h"
#include "cng_implementations.h"
#include "sc_implementations.h"
#include "ref_implementations.h"
SYMCRYPT_ENVIRONMENT_DEFS( Unittest );
char * g_implementationNames[] =
{
ImpSc::name,
ImpRsa32::name,
ImpRsa32b::name,
ImpCapi::name,
ImpCng::name,
ImpMsBignum::name,
ImpRef::name,
NULL,
};
#include "main_exe_common.cpp"
int __cdecl
main( int argc, _In_reads_( argc ) char * argv[] )
{
initTestInfrastructure( argc, argv );
TestSaveXmmEnabled = TRUE;
TestSaveYmmEnabled = TRUE;
addCapiAlgs();
addRsa32Algs();
addCngAlgs();
addMsBignumAlgs();
addSymCryptAlgs();
addRefAlgs();
if (!g_profile)
{
runFunctionalTests();
}
TestSaveXmmEnabled = FALSE;
TestSaveYmmEnabled = FALSE;
if (g_profile)
{
runProfiling();
}
else
{
runPerfTests();
testMultiThread();
testSelftest();
}
exitTestInfrastructure();
return 0;
}

Просмотреть файл

@ -0,0 +1,7 @@
//
// precomp.h Precompiled header file for SymCrypt unit test
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "test_lib.h"

19
unittest/exe_test/sources Normal file
Просмотреть файл

@ -0,0 +1,19 @@
TARGETNAME=symcryptunittest
# Target OneCore
BUILD_FOR_CORESYSTEM=1
C_DEFINES=$(C_DEFINES) -DTESTDRIVER_NAME=\"SymCryptDriver_test.sys\"
!include ..\sources_exe.inc
_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINTHRESHOLD)
TARGETLIBS= \
$(TARGETLIBS) \
$(MINCORE_SDK_LIB_PATH)\mincore.lib \
$(MINCORE_SDK_LIB_PATH)\mincore_legacy.lib \
$(MINCORE_SDK_LIB_PATH)\mincore_obsolete.lib \
# Linking CAPI is a bit of a mess as the proper macros are not available in our separate repo
$(PUBLIC_ROOT)\onecore\internal\minwin\priv_sdk\lib\$(TARGET_DIRECTORY)\api-ms-win-security-cryptoapi-l1-1-0.lib \

Просмотреть файл

@ -0,0 +1,5 @@
//
// Copyright (c) Microsoft Corp, all rigts reserved.
//
#include "..\symcryptunittest.rc"

34
unittest/iOS/helper.mm Normal file
Просмотреть файл

@ -0,0 +1,34 @@
//
// Helper functions for the iOS environment
//
#import <UIKit/UIKit.h>
#import <Security/Security.h>
#include "precomp.h"
KatData *
getCustomResource( PSTR resourceName, PSTR resourceType )
{
UNREFERENCED_PARAMETER(resourceType);
NSString *fullName = [NSString stringWithUTF8String: resourceName];
CHECK( fullName != NULL, "Failed to get the resource full name");
NSString *filePath = [[NSBundle mainBundle] pathForResource:[fullName stringByDeletingPathExtension] ofType:[fullName pathExtension]];
CHECK( filePath != NULL, "Failed to find resource");
NSData *content = [NSData dataWithContentsOfFile:filePath];
CHECK( content != NULL, "Failed to retrieve the content of the resource");
return new KatData( resourceName, (PCCHAR) [content bytes], [content length] );
}
NTSTATUS
IosGenRandom( PBYTE pbBuf, UINT32 cbBuf )
{
//arc4random_buf( (PBYTE)pbBuf, cbBuf );
return (NTSTATUS) SecRandomCopyBytes( kSecRandomDefault, cbBuf, pbBuf );
}

Просмотреть файл

@ -0,0 +1,70 @@
// Ignore the multi-character character constant warnings
#pragma GCC diagnostic ignored "-Wmultichar"
// Ignore the ISO C++ 11 does allow conversion from string literal to PSTR
#pragma GCC diagnostic ignored "-Wc++11-compat-deprecated-writable-strings"
// Ignore the unused entity issue with UNREFERENCED PARAMETER
#pragma GCC diagnostic ignored "-Wunused-value"
#define ULONG UINT32
#define DWORD UINT32
#define PSTR char *
#define PCSTR CONST PSTR
#define LPSTR PSTR
#define LPCSTR CONST PSTR
#define PUCHAR unsigned char *
#define WCHAR wchar_t
#define PWSTR wchar_t *
#define LPWSTR PWSTR
#define CONST const
#define CHAR char
#define LONGLONG INT64
#define ULONGLONG UINT64
#define ULONG_PTR UINT_PTR
#define BOOL BOOLEAN
#define NTSTATUS INT32
#define STATUS_NOT_SUPPORTED ((NTSTATUS)0xC00000BBL)
#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001L)
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
#define UNREFERENCED_PARAMETER(x) (x)
typedef enum {
BCRYPT_HASH_OPERATION_HASH_DATA = 1,
BCRYPT_HASH_OPERATION_FINISH_HASH = 2,
} BCRYPT_HASH_OPERATION_TYPE;
typedef struct _BCRYPT_MULTI_HASH_OPERATION {
uint32_t iHash; // index of hash object
BCRYPT_HASH_OPERATION_TYPE hashOperation; // operation to be performed
PUCHAR pbBuffer; // data to be hashed, or result buffer
uint32_t cbBuffer;
} BCRYPT_MULTI_HASH_OPERATION;
#if !defined min
#define min(a,b) \
({ __typeof__ (a) __a = (a); \
__typeof__ (b) __b = (b); \
__a < __b ? __a : __b; })
#endif
#if !defined max
#define max(a,b) \
({ __typeof__ (a) __a = (a); \
__typeof__ (b) __b = (b); \
__a > __b ? __a : __b; })
#endif

Просмотреть файл

@ -0,0 +1,502 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1A0F628A1B44C4F4003E026D /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A0F62891B44C4F4003E026D /* main.mm */; };
1A10CA271B4DC17400FA1526 /* helper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A10CA261B4DC17400FA1526 /* helper.mm */; };
1A5838A91B44BDD7002F4614 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A5838A81B44BDD7002F4614 /* AppDelegate.m */; };
1A5838AC1B44BDD7002F4614 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A5838AB1B44BDD7002F4614 /* ViewController.m */; };
1A5838AF1B44BDD7002F4614 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A5838AD1B44BDD7002F4614 /* Main.storyboard */; };
1A5838B11B44BDD7002F4614 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1A5838B01B44BDD7002F4614 /* Images.xcassets */; };
1A5838B41B44BDD8002F4614 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A5838B21B44BDD8002F4614 /* LaunchScreen.xib */; };
1A8E0FDE1B44C19200E5DCDC /* kat_authenc.dat in Resources */ = {isa = PBXBuildFile; fileRef = 1A8E0FD51B44C19200E5DCDC /* kat_authenc.dat */; };
1A8E0FDF1B44C19200E5DCDC /* kat_blockcipher.dat in Resources */ = {isa = PBXBuildFile; fileRef = 1A8E0FD61B44C19200E5DCDC /* kat_blockcipher.dat */; };
1A8E0FE01B44C19200E5DCDC /* kat_hash_long.dat in Resources */ = {isa = PBXBuildFile; fileRef = 1A8E0FD71B44C19200E5DCDC /* kat_hash_long.dat */; };
1A8E0FE11B44C19200E5DCDC /* kat_hash.dat in Resources */ = {isa = PBXBuildFile; fileRef = 1A8E0FD81B44C19200E5DCDC /* kat_hash.dat */; };
1A8E0FE21B44C19200E5DCDC /* kat_kdf.dat in Resources */ = {isa = PBXBuildFile; fileRef = 1A8E0FD91B44C19200E5DCDC /* kat_kdf.dat */; };
1A8E0FE31B44C19200E5DCDC /* kat_mac.dat in Resources */ = {isa = PBXBuildFile; fileRef = 1A8E0FDA1B44C19200E5DCDC /* kat_mac.dat */; };
1A8E0FE41B44C19200E5DCDC /* kat_rng.dat in Resources */ = {isa = PBXBuildFile; fileRef = 1A8E0FDB1B44C19200E5DCDC /* kat_rng.dat */; };
1A8E0FE51B44C19200E5DCDC /* kat_streamcipher.dat in Resources */ = {isa = PBXBuildFile; fileRef = 1A8E0FDC1B44C19200E5DCDC /* kat_streamcipher.dat */; };
1A8E0FE61B44C19200E5DCDC /* kat_xts.dat in Resources */ = {isa = PBXBuildFile; fileRef = 1A8E0FDD1B44C19200E5DCDC /* kat_xts.dat */; };
1A8E10031B44C25000E5DCDC /* env_SymCryptUnittest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FE81B44C25000E5DCDC /* env_SymCryptUnittest.cpp */; };
1A8E10041B44C25000E5DCDC /* kat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FE91B44C25000E5DCDC /* kat.cpp */; };
1A8E10051B44C25000E5DCDC /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FEB1B44C25000E5DCDC /* main.cpp */; };
1A8E10061B44C25000E5DCDC /* perfPrint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FEC1B44C25000E5DCDC /* perfPrint.cpp */; };
1A8E10071B44C25000E5DCDC /* printtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FEF1B44C25000E5DCDC /* printtable.cpp */; };
1A8E10081B44C25000E5DCDC /* resultMerge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FF11B44C25000E5DCDC /* resultMerge.cpp */; };
1A8E10091B44C25000E5DCDC /* rng.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FF31B44C25000E5DCDC /* rng.cpp */; };
1A8E100A1B44C25000E5DCDC /* sc_implementations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FF51B44C25000E5DCDC /* sc_implementations.cpp */; };
1A8E100B1B44C25000E5DCDC /* testAesCtrDrbg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FF71B44C25000E5DCDC /* testAesCtrDrbg.cpp */; };
1A8E100C1B44C25000E5DCDC /* testAuthEnc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FF81B44C25000E5DCDC /* testAuthEnc.cpp */; };
1A8E100D1B44C25000E5DCDC /* testBlockCiphers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FF91B44C25000E5DCDC /* testBlockCiphers.cpp */; };
1A8E100E1B44C25000E5DCDC /* testhash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FFA1B44C25000E5DCDC /* testhash.cpp */; };
1A8E100F1B44C25000E5DCDC /* testKdf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FFB1B44C25000E5DCDC /* testKdf.cpp */; };
1A8E10101B44C25000E5DCDC /* testMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FFC1B44C25000E5DCDC /* testMac.cpp */; };
1A8E10121B44C25000E5DCDC /* testSelftest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FFE1B44C25000E5DCDC /* testSelftest.cpp */; };
1A8E10131B44C25000E5DCDC /* testStreamCipher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E0FFF1B44C25000E5DCDC /* testStreamCipher.cpp */; };
1A8E10151B44C25000E5DCDC /* testWipe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E10011B44C25000E5DCDC /* testWipe.cpp */; };
1A8E10161B44C25000E5DCDC /* testXts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8E10021B44C25000E5DCDC /* testXts.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1A0F62891B44C4F4003E026D /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
1A10CA261B4DC17400FA1526 /* helper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = helper.mm; sourceTree = "<group>"; };
1A5838A01B44BDD7002F4614 /* symcryptunittest_iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = symcryptunittest_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
1A5838A41B44BDD7002F4614 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
1A5838A71B44BDD7002F4614 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
1A5838A81B44BDD7002F4614 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
1A5838AA1B44BDD7002F4614 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
1A5838AB1B44BDD7002F4614 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
1A5838AE1B44BDD7002F4614 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
1A5838B01B44BDD7002F4614 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
1A5838B31B44BDD8002F4614 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
1A8E0FCE1B44C14600E5DCDC /* symcrypt_inline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = symcrypt_inline.h; path = ../../inc/symcrypt_inline.h; sourceTree = "<group>"; };
1A8E0FCF1B44C14600E5DCDC /* symcrypt_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = symcrypt_internal.h; path = ../../inc/symcrypt_internal.h; sourceTree = "<group>"; };
1A8E0FD01B44C14600E5DCDC /* symcrypt_no_sal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = symcrypt_no_sal.h; path = ../../inc/symcrypt_no_sal.h; sourceTree = "<group>"; };
1A8E0FD11B44C14600E5DCDC /* symcrypt_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = symcrypt_types.h; path = ../../inc/symcrypt_types.h; sourceTree = "<group>"; };
1A8E0FD21B44C14600E5DCDC /* symcrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = symcrypt.h; path = ../../inc/symcrypt.h; sourceTree = "<group>"; };
1A8E0FD51B44C19200E5DCDC /* kat_authenc.dat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = kat_authenc.dat; path = ../kat_authenc.dat; sourceTree = "<group>"; };
1A8E0FD61B44C19200E5DCDC /* kat_blockcipher.dat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = kat_blockcipher.dat; path = ../kat_blockcipher.dat; sourceTree = "<group>"; };
1A8E0FD71B44C19200E5DCDC /* kat_hash_long.dat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = kat_hash_long.dat; path = ../kat_hash_long.dat; sourceTree = "<group>"; };
1A8E0FD81B44C19200E5DCDC /* kat_hash.dat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = kat_hash.dat; path = ../kat_hash.dat; sourceTree = "<group>"; };
1A8E0FD91B44C19200E5DCDC /* kat_kdf.dat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = kat_kdf.dat; path = ../kat_kdf.dat; sourceTree = "<group>"; };
1A8E0FDA1B44C19200E5DCDC /* kat_mac.dat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = kat_mac.dat; path = ../kat_mac.dat; sourceTree = "<group>"; };
1A8E0FDB1B44C19200E5DCDC /* kat_rng.dat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = kat_rng.dat; path = ../kat_rng.dat; sourceTree = "<group>"; };
1A8E0FDC1B44C19200E5DCDC /* kat_streamcipher.dat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = kat_streamcipher.dat; path = ../kat_streamcipher.dat; sourceTree = "<group>"; };
1A8E0FDD1B44C19200E5DCDC /* kat_xts.dat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = kat_xts.dat; path = ../kat_xts.dat; sourceTree = "<group>"; };
1A8E0FE71B44C25000E5DCDC /* algorithm_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = algorithm_base.h; path = ../algorithm_base.h; sourceTree = "<group>"; };
1A8E0FE81B44C25000E5DCDC /* env_SymCryptUnittest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = env_SymCryptUnittest.cpp; path = ../env_SymCryptUnittest.cpp; sourceTree = "<group>"; };
1A8E0FE91B44C25000E5DCDC /* kat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = kat.cpp; path = ../kat.cpp; sourceTree = "<group>"; };
1A8E0FEA1B44C25000E5DCDC /* kat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = kat.h; path = ../kat.h; sourceTree = "<group>"; };
1A8E0FEB1B44C25000E5DCDC /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../main.cpp; sourceTree = "<group>"; };
1A8E0FEC1B44C25000E5DCDC /* perfPrint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = perfPrint.cpp; path = ../perfPrint.cpp; sourceTree = "<group>"; };
1A8E0FED1B44C25000E5DCDC /* perfprint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = perfprint.h; path = ../perfprint.h; sourceTree = "<group>"; };
1A8E0FEE1B44C25000E5DCDC /* precomp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = precomp.h; path = ../precomp.h; sourceTree = "<group>"; };
1A8E0FEF1B44C25000E5DCDC /* printtable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = printtable.cpp; path = ../printtable.cpp; sourceTree = "<group>"; };
1A8E0FF01B44C25000E5DCDC /* printtable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = printtable.h; path = ../printtable.h; sourceTree = "<group>"; };
1A8E0FF11B44C25000E5DCDC /* resultMerge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = resultMerge.cpp; path = ../resultMerge.cpp; sourceTree = "<group>"; };
1A8E0FF21B44C25000E5DCDC /* resultMerge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = resultMerge.h; path = ../resultMerge.h; sourceTree = "<group>"; };
1A8E0FF31B44C25000E5DCDC /* rng.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rng.cpp; path = ../rng.cpp; sourceTree = "<group>"; };
1A8E0FF41B44C25000E5DCDC /* rng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rng.h; path = ../rng.h; sourceTree = "<group>"; };
1A8E0FF51B44C25000E5DCDC /* sc_implementations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sc_implementations.cpp; path = ../sc_implementations.cpp; sourceTree = "<group>"; };
1A8E0FF61B44C25000E5DCDC /* sc_implementations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sc_implementations.h; path = ../sc_implementations.h; sourceTree = "<group>"; };
1A8E0FF71B44C25000E5DCDC /* testAesCtrDrbg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testAesCtrDrbg.cpp; path = ../testAesCtrDrbg.cpp; sourceTree = "<group>"; };
1A8E0FF81B44C25000E5DCDC /* testAuthEnc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testAuthEnc.cpp; path = ../testAuthEnc.cpp; sourceTree = "<group>"; };
1A8E0FF91B44C25000E5DCDC /* testBlockCiphers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testBlockCiphers.cpp; path = ../testBlockCiphers.cpp; sourceTree = "<group>"; };
1A8E0FFA1B44C25000E5DCDC /* testhash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testhash.cpp; path = ../testhash.cpp; sourceTree = "<group>"; };
1A8E0FFB1B44C25000E5DCDC /* testKdf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testKdf.cpp; path = ../testKdf.cpp; sourceTree = "<group>"; };
1A8E0FFC1B44C25000E5DCDC /* testMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testMac.cpp; path = ../testMac.cpp; sourceTree = "<group>"; };
1A8E0FFE1B44C25000E5DCDC /* testSelftest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testSelftest.cpp; path = ../testSelftest.cpp; sourceTree = "<group>"; };
1A8E0FFF1B44C25000E5DCDC /* testStreamCipher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testStreamCipher.cpp; path = ../testStreamCipher.cpp; sourceTree = "<group>"; };
1A8E10011B44C25000E5DCDC /* testWipe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testWipe.cpp; path = ../testWipe.cpp; sourceTree = "<group>"; };
1A8E10021B44C25000E5DCDC /* testXts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testXts.cpp; path = ../testXts.cpp; sourceTree = "<group>"; };
1A8E10181B44C26C00E5DCDC /* precomp_iOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = precomp_iOS.h; sourceTree = "<group>"; };
1A8E101A1B44C2AF00E5DCDC /* sc_lib-testhooks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "sc_lib-testhooks.h"; path = "../../lib/sc_lib-testhooks.h"; sourceTree = "<group>"; };
1AF55A4F1B44CF7F006234C7 /* symcrypt.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = symcrypt.a; path = "../../Build_iOS/Products/Debug-iphonesimulator/symcrypt.a"; sourceTree = "<group>"; };
1AF55A511B44CF92006234C7 /* symcrypt.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = symcrypt.a; path = "../../Build_iOS/Products/Debug-iphoneos/symcrypt.a"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1A58389D1B44BDD7002F4614 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1A5838971B44BDD7002F4614 = {
isa = PBXGroup;
children = (
1A8E0FCD1B44C13500E5DCDC /* Resources */,
1A8E0FCC1B44C12B00E5DCDC /* Library */,
1A8E0FCB1B44C12200E5DCDC /* Sources */,
1A8E0FCA1B44C11800E5DCDC /* Headers */,
1A5838A21B44BDD7002F4614 /* symcryptunittest_iOS */,
1A5838A11B44BDD7002F4614 /* Products */,
);
sourceTree = "<group>";
};
1A5838A11B44BDD7002F4614 /* Products */ = {
isa = PBXGroup;
children = (
1A5838A01B44BDD7002F4614 /* symcryptunittest_iOS.app */,
);
name = Products;
sourceTree = "<group>";
};
1A5838A21B44BDD7002F4614 /* symcryptunittest_iOS */ = {
isa = PBXGroup;
children = (
1A5838A71B44BDD7002F4614 /* AppDelegate.h */,
1A5838A81B44BDD7002F4614 /* AppDelegate.m */,
1A5838AA1B44BDD7002F4614 /* ViewController.h */,
1A5838AB1B44BDD7002F4614 /* ViewController.m */,
1A5838AD1B44BDD7002F4614 /* Main.storyboard */,
1A5838B01B44BDD7002F4614 /* Images.xcassets */,
1A5838B21B44BDD8002F4614 /* LaunchScreen.xib */,
1A5838A31B44BDD7002F4614 /* Supporting Files */,
);
path = symcryptunittest_iOS;
sourceTree = "<group>";
};
1A5838A31B44BDD7002F4614 /* Supporting Files */ = {
isa = PBXGroup;
children = (
1A0F62891B44C4F4003E026D /* main.mm */,
1A5838A41B44BDD7002F4614 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
1A8E0FCA1B44C11800E5DCDC /* Headers */ = {
isa = PBXGroup;
children = (
1A8E0FCE1B44C14600E5DCDC /* symcrypt_inline.h */,
1A8E0FCF1B44C14600E5DCDC /* symcrypt_internal.h */,
1A8E0FD01B44C14600E5DCDC /* symcrypt_no_sal.h */,
1A8E0FD11B44C14600E5DCDC /* symcrypt_types.h */,
1A8E0FD21B44C14600E5DCDC /* symcrypt.h */,
);
name = Headers;
sourceTree = "<group>";
};
1A8E0FCB1B44C12200E5DCDC /* Sources */ = {
isa = PBXGroup;
children = (
1A10CA261B4DC17400FA1526 /* helper.mm */,
1A8E101A1B44C2AF00E5DCDC /* sc_lib-testhooks.h */,
1A8E10181B44C26C00E5DCDC /* precomp_iOS.h */,
1A8E0FE71B44C25000E5DCDC /* algorithm_base.h */,
1A8E0FE81B44C25000E5DCDC /* env_SymCryptUnittest.cpp */,
1A8E0FE91B44C25000E5DCDC /* kat.cpp */,
1A8E0FEA1B44C25000E5DCDC /* kat.h */,
1A8E0FEB1B44C25000E5DCDC /* main.cpp */,
1A8E0FEC1B44C25000E5DCDC /* perfPrint.cpp */,
1A8E0FED1B44C25000E5DCDC /* perfprint.h */,
1A8E0FEE1B44C25000E5DCDC /* precomp.h */,
1A8E0FEF1B44C25000E5DCDC /* printtable.cpp */,
1A8E0FF01B44C25000E5DCDC /* printtable.h */,
1A8E0FF11B44C25000E5DCDC /* resultMerge.cpp */,
1A8E0FF21B44C25000E5DCDC /* resultMerge.h */,
1A8E0FF31B44C25000E5DCDC /* rng.cpp */,
1A8E0FF41B44C25000E5DCDC /* rng.h */,
1A8E0FF51B44C25000E5DCDC /* sc_implementations.cpp */,
1A8E0FF61B44C25000E5DCDC /* sc_implementations.h */,
1A8E0FF71B44C25000E5DCDC /* testAesCtrDrbg.cpp */,
1A8E0FF81B44C25000E5DCDC /* testAuthEnc.cpp */,
1A8E0FF91B44C25000E5DCDC /* testBlockCiphers.cpp */,
1A8E0FFA1B44C25000E5DCDC /* testhash.cpp */,
1A8E0FFB1B44C25000E5DCDC /* testKdf.cpp */,
1A8E0FFC1B44C25000E5DCDC /* testMac.cpp */,
1A8E0FFE1B44C25000E5DCDC /* testSelftest.cpp */,
1A8E0FFF1B44C25000E5DCDC /* testStreamCipher.cpp */,
1A8E10011B44C25000E5DCDC /* testWipe.cpp */,
1A8E10021B44C25000E5DCDC /* testXts.cpp */,
);
name = Sources;
sourceTree = "<group>";
};
1A8E0FCC1B44C12B00E5DCDC /* Library */ = {
isa = PBXGroup;
children = (
1AF55A4E1B44CF55006234C7 /* Debug-iphonesimulator */,
1AF55A4D1B44CF3E006234C7 /* Debug-iphoneos */,
);
name = Library;
sourceTree = "<group>";
};
1A8E0FCD1B44C13500E5DCDC /* Resources */ = {
isa = PBXGroup;
children = (
1A8E0FD51B44C19200E5DCDC /* kat_authenc.dat */,
1A8E0FD61B44C19200E5DCDC /* kat_blockcipher.dat */,
1A8E0FD71B44C19200E5DCDC /* kat_hash_long.dat */,
1A8E0FD81B44C19200E5DCDC /* kat_hash.dat */,
1A8E0FD91B44C19200E5DCDC /* kat_kdf.dat */,
1A8E0FDA1B44C19200E5DCDC /* kat_mac.dat */,
1A8E0FDB1B44C19200E5DCDC /* kat_rng.dat */,
1A8E0FDC1B44C19200E5DCDC /* kat_streamcipher.dat */,
1A8E0FDD1B44C19200E5DCDC /* kat_xts.dat */,
);
name = Resources;
sourceTree = "<group>";
};
1AF55A4D1B44CF3E006234C7 /* Debug-iphoneos */ = {
isa = PBXGroup;
children = (
1AF55A511B44CF92006234C7 /* symcrypt.a */,
);
name = "Debug-iphoneos";
sourceTree = "<group>";
};
1AF55A4E1B44CF55006234C7 /* Debug-iphonesimulator */ = {
isa = PBXGroup;
children = (
1AF55A4F1B44CF7F006234C7 /* symcrypt.a */,
);
name = "Debug-iphonesimulator";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1A58389F1B44BDD7002F4614 /* symcryptunittest_iOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1A5838C31B44BDD8002F4614 /* Build configuration list for PBXNativeTarget "symcryptunittest_iOS" */;
buildPhases = (
1A58389C1B44BDD7002F4614 /* Sources */,
1A58389D1B44BDD7002F4614 /* Frameworks */,
1A58389E1B44BDD7002F4614 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = symcryptunittest_iOS;
productName = symcryptunittest_iOS;
productReference = 1A5838A01B44BDD7002F4614 /* symcryptunittest_iOS.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
1A5838981B44BDD7002F4614 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0620;
ORGANIZATIONNAME = Microsoft;
TargetAttributes = {
1A58389F1B44BDD7002F4614 = {
CreatedOnToolsVersion = 6.2;
};
};
};
buildConfigurationList = 1A58389B1B44BDD7002F4614 /* Build configuration list for PBXProject "symcryptunittest_iOS" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 1A5838971B44BDD7002F4614;
productRefGroup = 1A5838A11B44BDD7002F4614 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
1A58389F1B44BDD7002F4614 /* symcryptunittest_iOS */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1A58389E1B44BDD7002F4614 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1A8E0FE11B44C19200E5DCDC /* kat_hash.dat in Resources */,
1A8E0FE51B44C19200E5DCDC /* kat_streamcipher.dat in Resources */,
1A8E0FE01B44C19200E5DCDC /* kat_hash_long.dat in Resources */,
1A8E0FE31B44C19200E5DCDC /* kat_mac.dat in Resources */,
1A5838AF1B44BDD7002F4614 /* Main.storyboard in Resources */,
1A8E0FDF1B44C19200E5DCDC /* kat_blockcipher.dat in Resources */,
1A8E0FDE1B44C19200E5DCDC /* kat_authenc.dat in Resources */,
1A8E0FE41B44C19200E5DCDC /* kat_rng.dat in Resources */,
1A8E0FE61B44C19200E5DCDC /* kat_xts.dat in Resources */,
1A5838B41B44BDD8002F4614 /* LaunchScreen.xib in Resources */,
1A8E0FE21B44C19200E5DCDC /* kat_kdf.dat in Resources */,
1A5838B11B44BDD7002F4614 /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1A58389C1B44BDD7002F4614 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1A8E100D1B44C25000E5DCDC /* testBlockCiphers.cpp in Sources */,
1A8E100F1B44C25000E5DCDC /* testKdf.cpp in Sources */,
1A8E100B1B44C25000E5DCDC /* testAesCtrDrbg.cpp in Sources */,
1A10CA271B4DC17400FA1526 /* helper.mm in Sources */,
1A8E10031B44C25000E5DCDC /* env_SymCryptUnittest.cpp in Sources */,
1A8E10091B44C25000E5DCDC /* rng.cpp in Sources */,
1A8E10081B44C25000E5DCDC /* resultMerge.cpp in Sources */,
1A5838AC1B44BDD7002F4614 /* ViewController.m in Sources */,
1A8E10051B44C25000E5DCDC /* main.cpp in Sources */,
1A8E100E1B44C25000E5DCDC /* testhash.cpp in Sources */,
1A8E10061B44C25000E5DCDC /* perfPrint.cpp in Sources */,
1A8E10071B44C25000E5DCDC /* printtable.cpp in Sources */,
1A8E10121B44C25000E5DCDC /* testSelftest.cpp in Sources */,
1A0F628A1B44C4F4003E026D /* main.mm in Sources */,
1A8E10041B44C25000E5DCDC /* kat.cpp in Sources */,
1A8E10151B44C25000E5DCDC /* testWipe.cpp in Sources */,
1A8E100C1B44C25000E5DCDC /* testAuthEnc.cpp in Sources */,
1A8E10161B44C25000E5DCDC /* testXts.cpp in Sources */,
1A5838A91B44BDD7002F4614 /* AppDelegate.m in Sources */,
1A8E100A1B44C25000E5DCDC /* sc_implementations.cpp in Sources */,
1A8E10131B44C25000E5DCDC /* testStreamCipher.cpp in Sources */,
1A8E10101B44C25000E5DCDC /* testMac.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
1A5838AD1B44BDD7002F4614 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
1A5838AE1B44BDD7002F4614 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
1A5838B21B44BDD8002F4614 /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
1A5838B31B44BDD8002F4614 /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
1A5838C11B44BDD8002F4614 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
1A5838C21B44BDD8002F4614 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
1A5838C41B44BDD8002F4614 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
GCC_C_LANGUAGE_STANDARD = gnu99;
INFOPLIST_FILE = symcryptunittest_iOS/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
"OTHER_LDFLAGS[sdk=iphoneos*]" = "../../Build/Products/Debug-iphoneos/symcrypt.a";
"OTHER_LDFLAGS[sdk=iphonesimulator*]" = "../../Build/Products/Debug-iphonesimulator/symcrypt.a";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
1A5838C51B44BDD8002F4614 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
GCC_C_LANGUAGE_STANDARD = gnu99;
INFOPLIST_FILE = symcryptunittest_iOS/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1A58389B1B44BDD7002F4614 /* Build configuration list for PBXProject "symcryptunittest_iOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1A5838C11B44BDD8002F4614 /* Debug */,
1A5838C21B44BDD8002F4614 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1A5838C31B44BDD8002F4614 /* Build configuration list for PBXNativeTarget "symcryptunittest_iOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1A5838C41B44BDD8002F4614 /* Debug */,
1A5838C51B44BDD8002F4614 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 1A5838981B44BDD7002F4614 /* Project object */;
}

Просмотреть файл

@ -0,0 +1,17 @@
//
// AppDelegate.h
// symcryptunittest_iOS
//
// Created by Yannis Rouselakis on 7/1/15.
// Copyright (c) 2015 Microsoft. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

Просмотреть файл

@ -0,0 +1,45 @@
//
// AppDelegate.m
// symcryptunittest_iOS
//
// Created by Yannis Rouselakis on 7/1/15.
// Copyright (c) 2015 Microsoft. All rights reserved.
//
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end

Просмотреть файл

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Microsoft. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="symcryptunittest_iOS" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>

Просмотреть файл

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

Просмотреть файл

@ -0,0 +1,38 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>Microsoft.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,15 @@
//
// ViewController.h
// symcryptunittest_iOS
//
// Created by Yannis Rouselakis on 7/1/15.
// Copyright (c) 2015 Microsoft. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end

Просмотреть файл

@ -0,0 +1,27 @@
//
// ViewController.m
// symcryptunittest_iOS
//
// Created by Yannis Rouselakis on 7/1/15.
// Copyright (c) 2015 Microsoft. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end

Просмотреть файл

@ -0,0 +1,37 @@
//
// main.mm
// symcryptunittest_iOS
//
// Created by Yannis Rouselakis on 7/1/15.
// Copyright (c) 2015 Microsoft. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#include <stdio.h>
#include "precomp.h"
#include "sc_implementations.h"
SYMCRYPT_ENVIRONMENT_GENERIC
char * g_implementationNames[] =
{
ImpSc::name,
NULL,
};
int main(int argc, char * argv[]) {
initTestInfrastructure(0, NULL);
addSymCryptAlgs();
runFunctionalTests();
exitTestInfrastructure();
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,52 @@
//
// capi_implementations.h Header file for CAPI implementations
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include <wincrypt.h>
extern HCRYPTPROV g_capiProvider;
//
// Stub classes used as selector in templates. This class is never instantiated.
//
class ImpCapi{
public:
static char * name;
};
//
// Storage for the hash implementation
//
template< class Algorithm >
class HashImpState<ImpCapi, Algorithm> {
public:
HCRYPTHASH hHash;
};
template< class Algorithm >
class MacImpState<ImpCapi, Algorithm> {
public:
HCRYPTKEY hKey;
HCRYPTHASH hHash;
};
#define CAPI_CALG_ARRAY_SIZE 256
#define CAPI_MAX_KEY_SIZE 256
template< class Algorithm, class Mode>
class BlockCipherImpState<ImpCapi, Algorithm, Mode> {
public:
static ULONG calg[CAPI_CALG_ARRAY_SIZE]; // One calg for each key size
HCRYPTKEY hKey;
};
template<class Algorithm>
class StreamCipherImpState<ImpCapi, Algorithm> {
public:
HCRYPTKEY hKey;
};

Просмотреть файл

@ -0,0 +1,130 @@
//
// cng_implementations.h Header file for CNG implementations
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
VOID
SetCngKeySizeFlag();
VOID
AddBCryptBuffer( BCryptBufferDesc * pBufferDesc, ULONG BufferType, PCVOID pData, SIZE_T cbData );
//
// Stub classes used as selector in templates. This class is never instantiated.
//
class ImpCng{
public:
static char * name;
};
template< class Algorithm >
class HashImpState<ImpCng, Algorithm> {
public:
static BCRYPT_ALG_HANDLE hAlg; // Handle to algorithm provider
//
// Data for the ongoing hash computation
//
BYTE hashObjectBuffer[1024];
BCRYPT_HASH_HANDLE hHash;
};
template< class Algorithm >
class ParallelHashImpState<ImpCng, Algorithm> {
public:
static BCRYPT_ALG_HANDLE hAlg; // handle to alg provider
BYTE hashObjectBuffer[(5 + MAX_PARALLEL_HASH_STATES) * 1024];
BCRYPT_HASH_HANDLE hHash;
};
template< class Algorithm >
class MacImpState<ImpCng, Algorithm> {
public:
static BCRYPT_ALG_HANDLE hAlg;
//
// Data for the ongoing mac computation
//
BYTE hashObjectBuffer[1024];
BCRYPT_HASH_HANDLE hHash;
};
template< class Algorithm, class Mode >
class BlockCipherImpState<ImpCng, Algorithm, Mode> {
public:
static BCRYPT_ALG_HANDLE hAlg;
DWORD keyObjSize;
PULONG pMagic; // Pointer to magic value that should not be overwritten by the key object.
BCRYPT_KEY_HANDLE hKey;
//
// Data for the key
//
BYTE keyObjectBuffer[768];
};
template< class Algorithm, class Mode >
class AuthEncImpState<ImpCng, Algorithm, Mode> {
public:
static BCRYPT_ALG_HANDLE hAlg;
BCRYPT_ALG_HANDLE hAlgNoMode;
SIZE_T totalCbData; // Used for CCM but not GCM
DWORD keyObjSizeSmall;
DWORD keyObjSizeBig;
BCRYPT_KEY_HANDLE hKey;
BOOL inComputation;
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO authInfo;
BYTE abMacContext[16]; // Mac context buffer used for chaining calls.
PULONG pMagic; // Pointer to magic value that should not be overwritten by the key object.
//
// Data for the key
//
BYTE keyObjectBuffer[1 << 12]; // AES/GCM key can be 2.5 kB or so.
};
template< class Algorithm >
class StreamCipherImpState<ImpCng, Algorithm> {
public:
static BCRYPT_ALG_HANDLE hAlg;
BYTE keyObjectBuffer[768];
BCRYPT_KEY_HANDLE hKey;
};
template< class Algorithm >
class RngSp800_90ImpState<ImpCng, Algorithm> {
public:
};
template< class Algorithm, class BaseAlg >
class KdfImpState<ImpCng, Algorithm, BaseAlg > {
public:
static BCRYPT_ALG_HANDLE hAlg; // handle to the KDF algorithm
BCRYPT_ALG_HANDLE hBaseAlg; // handle to the PRF algorithm
};
template<>
class XtsImpState<ImpCng, AlgXtsAes> {
public:
BCRYPT_KEY_HANDLE hKey;
PULONG pMagic; // Pointer to magic value that should not be overwritten by the key object.
DWORD keyObjSize;
BYTE keyObjectBuffer[2048];
//
// No need for alg handle. XTS is only available when we have Pseudo-handles.
//
};

Просмотреть файл

@ -0,0 +1,51 @@
//
// hash_imp_pattern.h
//
// Pattern file for the hash implementations.
// This file is #included with two macros defined:
// HASH_NAME name of hash function in all caps
// HASH_Name name of hash function with one capital letter and the rest lowercase
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
class HASH_CLASS_NAME( HASH_Name ): public HashImplementation
{
public:
HASH_CLASS_NAME(HASH_Name)() {};
virtual ~HASH_CLASS_NAME(HASH_Name)() {};
private:
HASH_CLASS_NAME(HASH_Name)( const & HASH_CLASS_NAME(HASH_Name) );
VOID operator=( const & HASH_CLASS_NAME(HASH_Name) );
public:
static const std::string s_algName;
static const std::string s_impName;
virtual SIZE_T resultLen();
virtual SIZE_T inputBlockLen();
virtual HashComputation * newHashComputation();
virtual VOID hash( PCBYTE pbData, SIZE_T cbData, PBYTE pbResult, SIZE_T cbResult );
};
class HASH_COMP_CLASS_NAME( HASH_Name ): public HashComputation
{
public:
HASH_COMP_CLASS_NAME( HASH_Name )() {};
virtual ~HASH_COMP_CLASS_NAME( HASH_Name ) () {};
private:
HASH_COMP_CLASS_NAME( HASH_Name )( const & HASH_COMP_CLASS_NAME( HASH_Name ) );
VOID operator=( const & HASH_COMP_CLASS_NAME( HASH_Name ) );
public:
virtual void init();
virtual void append( PCBYTE pbData, SIZE_T cbData );
virtual void result( PBYTE pbResult, SIZE_T cbResult );
HASH_STATE( HASH_NAME ) state;
};

31
unittest/inc/ioctlDefs.h Normal file
Просмотреть файл

@ -0,0 +1,31 @@
//
// ioctlDefs.h
// Definitions for IOCTL contract to the test driver
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Define the IOCTL, and the two structures to be passed in and out of the IOCTL.
//
#define DEVICE_NAME L"\\Device\\SymCryptTest"
#define IOCTL_RUN_TEST CTL_CODE( FILE_DEVICE_UNKNOWN, 0, METHOD_BUFFERED, FILE_ANY_ACCESS )
#pragma pack(push, 8 )
typedef struct _KM_TEST_INPUT {
SYMCRYPT_CPU_FEATURES disable; // which CPU features to disable
} KM_TEST_INPUT;
typedef struct _KM_TEST_RESULT {
SYMCRYPT_CPU_FEATURES featuresUsed;
ULONG firstSymCryptError; // 0 if no error, otherwise the first fatalCode encountered
ULONG mainThreadError; // 0 if no error, or an NTSTATUS if the main thread had an error
ULONGLONG nTestCases; // # test cases run
ULONGLONG nDpcsOnCpu[64]; // # DPCs run on each logical CPU
} KM_TEST_RESULT;
#pragma pack(pop)

94
unittest/inc/kat.h Normal file
Просмотреть файл

@ -0,0 +1,94 @@
//
// KAT file infrastructure
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Our KAT files have the following generic format:
//
// ASCII text
// Category markers of the form [text] at the start of a line.
// Data sets consist of one or more records terminated by an empty line,
// category marker, or end-of-file.
// Each record is of the form fieldname = data.
// White space is ignored and stripped where possible.
// Comments are anything starting with # and running to the end of the line
// Comments can appear anywhere where whitespace can.
//
typedef enum{
KAT_TYPE_CATEGORY, // a [<text>] category marker. Text is in categoryName field
KAT_TYPE_DATASET,
KAT_TYPE_END
} KAT_ITEM_TYPE;
typedef struct _KAT_DATA_ITEM
{
String name;
String data;
LONGLONG line; // line number
} KAT_DATA_ITEM;
typedef std::vector<KAT_DATA_ITEM> DataItems;
typedef struct _KAT_RECORD
{
KAT_ITEM_TYPE type;
String categoryName;
DataItems dataItems;
LONGLONG line; // line number of first line in record
} KAT_ITEM, *PKAT_ITEM;
class KatData
{
public:
KatData( _In_ PSTR name, _In_ PCCHAR pbData, SIZE_T cbData );
// Provide name, pointer, and length of data to be parsed
~KatData() {};
private:
KatData( const KatData & );
VOID operator=( const KatData & );
int next();
BOOL isEmpty();
VOID advance();
VOID skipSpace();
VOID skipNewlines();
BOOL atEol();
public:
PCCHAR m_pbData; // Current data location
PCCHAR m_pbEnd; // End of data
LONGLONG m_line; // Current line number
LPSTR m_name; // Name of file/resource
LONGLONG line();
VOID getKatItem( PKAT_ITEM pKat );
};
BString katParseData( KAT_ITEM & item, LPCSTR name );
//
// Turn a string notation into a binary string.
// There are several encodings used:
// - Hex string
// - text string delimited with double quotes
// - 'repeat' '(' <integer> ')' <encoded string>
// line number is passed for error reporting purposes.
//
LONGLONG katParseInteger( KAT_ITEM & item, LPCSTR name );
BOOL katIsFieldPresent( KAT_ITEM & item, LPCSTR name );
const KAT_DATA_ITEM * findDataItem( KAT_ITEM & item, LPCSTR name );

Просмотреть файл

@ -0,0 +1,98 @@
//
// main_inline.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
template< typename AlgImp >
VOID addImplementationToGlobalList()
{
std::string algName = AlgImp::s_algName;
std::string impName = AlgImp::s_impName;
std::string modeName = AlgImp::s_modeName;
if( setContainsPrefix( g_algorithmsToTest, algName ) &&
setContainsPrefix( g_implementationsToTest, impName ) )
{
AlgorithmImplementation * p;
try
{
p = new AlgImp();
}
catch( NTSTATUS status )
{
UNREFERENCED_PARAMETER( status );
iprint( "\nUnsupported algorithm %s/%s, skipping...\n", impName.c_str(), algName.c_str() );
return;
}
p->m_algorithmName = algName;
p->m_implementationName = impName;
p->m_modeName = modeName;
g_algorithmImplementation.push_back( p );
}
}
template< typename AlgImp >
VOID addImplementationToList(AlgorithmImplementationVector * pAlgorithmImplementationVector)
{
std::string algName = AlgImp::s_algName;
std::string impName = AlgImp::s_impName;
std::string modeName = AlgImp::s_modeName;
AlgorithmImplementation * p;
try
{
p = new AlgImp();
}
catch( NTSTATUS status )
{
UNREFERENCED_PARAMETER( status );
iprint( "\nUnsupported algorithm %s/%s, skipping...\n", impName.c_str(), algName.c_str() );
return;
}
p->m_algorithmName = algName;
p->m_implementationName = impName;
p->m_modeName = modeName;
(*pAlgorithmImplementationVector).push_back( p );
}
template< typename AlgType >
std::auto_ptr<std::vector< AlgType * >> getAlgorithmsOfOneType()
{
std::auto_ptr<std::vector< AlgType * >> result( new std::vector< AlgType * > );
for( std::vector<AlgorithmImplementation *>::iterator i = g_algorithmImplementation.begin();
i != g_algorithmImplementation.end();
i++ )
{
AlgType * pAlg;
pAlg = dynamic_cast< AlgType * > (*i);
if( pAlg != NULL )
{
result->push_back( pAlg );
}
}
return result;
}
template<typename AlgorithmType>
VOID getAllImplementations( String algName, std::vector<AlgorithmType *> *res )
{
for( AlgorithmImplementationVector::const_iterator i= g_algorithmImplementation.begin(); i != g_algorithmImplementation.end(); ++i )
{
if( (*i)->m_algorithmName + (*i)->m_modeName == algName )
{
AlgorithmType * p = dynamic_cast< AlgorithmType *>( *i );
CHECK( p != NULL, "Wrong algorithm name/type combo" );
res->push_back( p );
}
}
}
BOOL
isAlgorithmPresent( String algName, BOOL isPrefix );

Просмотреть файл

@ -0,0 +1,19 @@
//
// MsBignum implementation classes
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Header files for msbignum
//
#include <msbignum.h>
#include <ecurve.h>
#include <ms_generic_ecc.h>
class ImpMsBignum{
public:
static char * name;
};

33
unittest/inc/perf.h Normal file
Просмотреть файл

@ -0,0 +1,33 @@
//
// Performance measuring infrastructure header
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// The perf measuring is complicated. The P4 has all kind of alignment issues;
// The L1 cache can't hold two cache lines that are aliased mod 64 kB. This leads
// to huge perf differences that are all bogus if you try to compare implementations.
//
// We solve this by running measurements using many different addresses.
// Each perf function can use up to four memory addresses, each of which is at least
// one MB large. We chose random pointer addresses and run the tests many times.
// We also move the stack around, as the code is unmovable.
//
//
// For algorithms that specify a keying function the keying function will be called before the data
// function. The keying function should set up any necessary expanded key.
//
typedef VOID (*PerfKeyFn )( PBYTE buf1, PBYTE buf2, PBYTE buf3, SIZE_T keySize );
typedef VOID (*PerfDataFn )( PBYTE buf1, PBYTE buf2, PBYTE buf3, SIZE_T dataSize );
typedef VOID (*PerfCleanFn)( PBYTE buf1, PBYTE buf2, PBYTE buf3 );
#define PERF_BUFFER_SIZE (1<<18)
VOID measurePerf();
extern PSTR g_perfUnits;

30
unittest/inc/perfprint.h Normal file
Просмотреть файл

@ -0,0 +1,30 @@
//
// PerfPrint.h
// Printing output without affecting performance measurements
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
VOID
print( const char *format, ...);
VOID
print( String s );
VOID
printHex( PCBYTE pbData, SIZE_T cbData );
String
formatNumber( double v );
VOID
iprint( const char *format, ...);
VOID
dprint( const char *format, ...); // Only prints if #if is modified in source code, used for debugging.
VOID printOutput( int delayMilliSeconds );
VOID
vprint( BOOL bPrint, const char *format, ...); // Only prints if bPrint == TRUE

36
unittest/inc/printtable.h Normal file
Просмотреть файл

@ -0,0 +1,36 @@
//
// PrintTable.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
class PrintTable
{
public:
PrintTable();
~PrintTable();
private:
PrintTable( const PrintTable & );
void operator=( const PrintTable & );
public:
VOID addItem( String row, String col, String item );
VOID addItem( String row, String col, ULONGLONG value );
VOID addItemNonZero( String row, String col, ULONGLONG value );
VOID addItem( String row, String col, double perByte, double overhead, double range );
VOID clear();
VOID print( String heading );
private:
typedef std::pair<String,String> RowCol;
typedef std::vector<String> StringVector;
typedef std::map<RowCol, String> ItemMap;
StringVector m_rows;
StringVector m_cols;
ItemMap m_items;
};

Просмотреть файл

@ -0,0 +1,34 @@
//
// ref_implementations.h Header file for reference implementations
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Stub classes used as selector in templates. This class is never instantiated.
//
class ImpRef{
public:
static char * name;
};
typedef struct _REF_POLY1305_STATE {
PSYMCRYPT_MODULUS pmMod;
PSYMCRYPT_MODELEMENT peAcc;
PSYMCRYPT_MODELEMENT peR;
PSYMCRYPT_MODELEMENT peData;
PSYMCRYPT_INT piS;
PSYMCRYPT_INT piAcc; // Used for final addition
BYTE block[17];
SIZE_T bytesInBuffer;
} REF_POLY1305_STATE, *PREF_POLY1305_STATE;
template<>
class MacImpState<ImpRef, AlgPoly1305> {
public:
REF_POLY1305_STATE state;
};

Просмотреть файл

@ -0,0 +1,37 @@
//
// Result merge infrastructure
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
class ResultMerge {
public:
ResultMerge();
~ResultMerge();
private:
ResultMerge( const ResultMerge & );
VOID operator=( const ResultMerge & );
public:
VOID addResult(
_In_ AlgorithmImplementation * pAlgImp,
_In_reads_( cbData ) PCBYTE pbData,
SIZE_T cbData );
VOID getResult(
_Out_writes_( cbResult ) PBYTE pbResult,
SIZE_T cbResult,
BOOL countInvocation = TRUE );
private:
typedef struct
{
AlgorithmImplementation * pAlgImp;
BString strData;
SIZE_T nAgree;
} ResultItem;
std::vector<ResultItem> m_results;
};

24
unittest/inc/rndDriver.h Normal file
Просмотреть файл

@ -0,0 +1,24 @@
//
// rndDriver.h Header file for random test driver
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
typedef VOID (* RNDD_TEST_FN)();
VOID
rnddRegisterTestFunction( RNDD_TEST_FN func, _In_ PSTR name, UINT32 weight );
VOID
rnddRegisterInitFunction( RNDD_TEST_FN func );
VOID
rnddRegisterCleanupFunction( RNDD_TEST_FN func );
VOID
rnddRegisterInvariantFunction( RNDD_TEST_FN func );
VOID
rnddRunTest( UINT32 nSeconds, UINT32 nThreads );

53
unittest/inc/rng.h Normal file
Просмотреть файл

@ -0,0 +1,53 @@
//
// rng.h Header file for test RNG
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// We use our own predictable RNG so that we can be repeatable.
//
class Rng
{
public:
Rng();
~Rng();
private:
Rng( const Rng &);
void operator=( const Rng & );
public:
VOID reset( PCBYTE pbData, SIZE_T cbData );
_Ret_range_( min, upb-1 )
SIZE_T sizet( SIZE_T min, SIZE_T upb ); // Return random value in range min,...,upb-1
_Ret_range_( 0, upb-1 )
SIZE_T sizet( SIZE_T upb ); // Return random value in range 0,...,upb-1
_Ret_range_( 0, upb-1 )
SIZE_T sizetNonUniform( SIZE_T upb, SIZE_T UniformProbLimit, ULONG logIncrease );
// Return random value in range 0..upb-1
// Distribution is nonuniform.
// Distribution is the sum of a number of uniform distributions.
// The first one has prob 1/2 and extend 0..UniformProbLimit -1;
// Subsequent ones have half the probability and are 2^logIncrease bigger,
// limited by the upb.
VOID randomSubRange( SIZE_T bufSize, SIZE_T * pStart, SIZE_T * pLen );
// Returns start & length of a random subrange in a buffer of size bufSize.
BYTE byte();
UINT32 uint32();
private:
BYTE m_seed[SYMCRYPT_SHA1_RESULT_SIZE];
ULONGLONG m_blockCtr;
SIZE_T m_bytesInBuf;
BYTE m_buf[SYMCRYPT_SHA1_RESULT_SIZE];
};

Просмотреть файл

@ -0,0 +1,217 @@
//
// RSA32 implementation classes
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Header files for RSA32.lib
//
//#include <modes.h>
#include <aes.h>
#include "aesfast.h"
#include "sha.h"
#include "sha2.h"
#include "md5.h"
#include "md4.h"
#include "md2.h"
#include "hmac.h"
#include "modes.h"
#include "aesfast.h"
#include "des.h"
#include "tripldes.h"
#include "rc2.h"
#include "hmac.h"
#include "aes_ccm.h"
extern "C" {
#include "aes_gcm.h"
}
#include "rc4.h"
//
// Create a naming convention for result length and input block length.
// Values not defined by the RSA32.lib headers are taken from the symcrypt headers
//
#define RSA32_MD2_RESULT_SIZE SYMCRYPT_MD2_RESULT_SIZE
#define RSA32_MD2_INPUT_BLOCK_SIZE SYMCRYPT_MD2_INPUT_BLOCK_SIZE
#define RSA32_MD4_RESULT_SIZE SYMCRYPT_MD4_RESULT_SIZE
#define RSA32_MD4_INPUT_BLOCK_SIZE SYMCRYPT_MD4_INPUT_BLOCK_SIZE
#define RSA32_OLDMD4_RESULT_SIZE SYMCRYPT_MD4_RESULT_SIZE
#define RSA32_OLDMD4_INPUT_BLOCK_SIZE SYMCRYPT_MD4_INPUT_BLOCK_SIZE
#define RSA32_MD5_RESULT_SIZE MD5DIGESTLEN
#define RSA32_MD5_INPUT_BLOCK_SIZE SYMCRYPT_MD5_INPUT_BLOCK_SIZE
#define RSA32_SHA1_RESULT_SIZE A_SHA_DIGEST_LEN
#define RSA32_SHA1_INPUT_BLOCK_SIZE SYMCRYPT_SHA1_INPUT_BLOCK_SIZE
#define RSA32_SHA256_RESULT_SIZE SHA256_DIGEST_LEN
#define RSA32_SHA256_INPUT_BLOCK_SIZE SYMCRYPT_SHA256_INPUT_BLOCK_SIZE
#define RSA32_SHA384_RESULT_SIZE SHA384_DIGEST_LEN
#define RSA32_SHA384_INPUT_BLOCK_SIZE SYMCRYPT_SHA384_INPUT_BLOCK_SIZE
#define RSA32_SHA512_RESULT_SIZE SHA512_DIGEST_LEN
#define RSA32_SHA512_INPUT_BLOCK_SIZE SYMCRYPT_SHA512_INPUT_BLOCK_SIZE
#define RSA32_HMAC_MD5_INPUT_BLOCK_SIZE RSA32_MD5_INPUT_BLOCK_SIZE
#define RSA32_HMAC_SHA1_INPUT_BLOCK_SIZE RSA32_SHA1_INPUT_BLOCK_SIZE
#define RSA32_HMAC_MD5_RESULT_SIZE RSA32_MD5_RESULT_SIZE
#define RSA32_HMAC_SHA1_RESULT_SIZE RSA32_SHA1_RESULT_SIZE
#define RSA32B_MD4_RESULT_SIZE MD4DIGESTLEN
#define RSA32B_MD4_INPUT_BLOCK_SIZE SYMCRYPT_MD4_INPUT_BLOCK_SIZE
#define RSA32_AES_BLOCK_SIZE AES_BLOCK_SIZE
#define RSA32_DES_BLOCK_SIZE DES_BLOCKLEN
#define RSA32_3DES_BLOCK_SIZE DES_BLOCKLEN
#define RSA32_RC2_BLOCK_SIZE RC2_BLOCKLEN
//
// Stub classes used as selector in templates. This class is never instantiated.
// Some algorithms have 2 implementations in RSA32.lib. We treat this as two
// different implementation names, 'rsa32' and 'rsa32b'.
//
class ImpRsa32{
public:
static char * name;
};
class ImpRsa32b{
public:
static char * name;
};
template<>
class HashImpState<ImpRsa32, AlgMd2> {
public:
MD2_CTX ctx;
};
template<>
class HashImpState<ImpRsa32, AlgMd4> {
public:
MD4_CTX ctx;
};
template<>
class HashImpState<ImpRsa32b, AlgMd4> {
public:
MDstruct md4;
BYTE buf[RSA32B_MD4_INPUT_BLOCK_SIZE];
SIZE_T bytesInBuf;
};
template<>
class HashImpState<ImpRsa32, AlgMd5> {
public:
MD5_CTX ctx;
};
template<>
class HashImpState<ImpRsa32, AlgSha1> {
public:
A_SHA_CTX ctx;
};
template<>
class HashImpState<ImpRsa32, AlgSha256> {
public:
SHA256_CTX ctx;
};
template<>
class HashImpState<ImpRsa32, AlgSha384> {
public:
SHA384_CTX ctx;
};
template<>
class HashImpState<ImpRsa32, AlgSha512> {
public:
SHA512_CTX ctx;
};
template<>
class MacImpState<ImpRsa32, AlgHmacMd5> {
public:
HMACMD5_CTX keyCtx;
HMACMD5_CTX macCtx;
};
template<>
class MacImpState<ImpRsa32, AlgHmacSha1> {
public:
HMACSHA_CTX keyCtx;
HMACSHA_CTX macCtx;
};
template<class Mode>
class BlockCipherImpState<ImpRsa32, AlgAes, Mode> {
public:
AES_KEY key;
};
template<class Mode>
class BlockCipherImpState<ImpRsa32b, AlgAes, Mode> {
public:
AESTable key;
};
template<class Mode>
class BlockCipherImpState<ImpRsa32, AlgDes, Mode> {
public:
DESTable key;
};
template<class Mode>
class BlockCipherImpState<ImpRsa32, Alg2Des, Mode> {
public:
DES3TABLE key;
};
template<class Mode>
class BlockCipherImpState<ImpRsa32, Alg3Des, Mode> {
public:
DES3TABLE key;
};
template<class Mode>
class BlockCipherImpState<ImpRsa32, AlgDesx, Mode> {
public:
DESXTable key;
};
typedef struct _RC2_KEY
{
WORD key[RC2_TABLESIZE];
} RSA32_RC2_KEY;
template<class Mode>
class BlockCipherImpState<ImpRsa32, AlgRc2, Mode> {
public:
RSA32_RC2_KEY key;
};
template<class Mode>
class AuthEncImpState<ImpRsa32, AlgAes, Mode> {
public:
AES_KEY key;
};
template<>
class StreamCipherImpState<ImpRsa32, AlgRc4> {
public:
RC4_KEYSTRUCT state;
};

Просмотреть файл

@ -0,0 +1,274 @@
//
// SymCrypt implementation classes
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// The Marvin API names use 'seed' instead of 'key'.
// Map them so that our infrastructure works
//
typedef SYMCRYPT_MARVIN32_EXPANDED_SEED SYMCRYPT_MARVIN32_EXPANDED_KEY, *PSYMCRYPT_MARVIN32_EXPANDED_KEY;
#define SymCryptMarvin32ExpandKey SymCryptMarvin32ExpandSeed
#define SymCryptMarvin32KeyCopy SymCryptMarvin32SeedCopy
class ImpSc{
public:
static char * name;
};
//
// Specialized Hash classes
//
template<>
class HashImpState<ImpSc, AlgMd2> {
public:
SYMCRYPT_MD2_STATE sc;
SYMCRYPT_HASH_STATE scHash;
BOOLEAN isReset;
};
template<>
class HashImpState<ImpSc, AlgMd4> {
public:
SYMCRYPT_MD4_STATE sc;
SYMCRYPT_HASH_STATE scHash;
BOOLEAN isReset;
};
template<>
class HashImpState<ImpSc, AlgMd5> {
public:
SYMCRYPT_MD5_STATE sc;
SYMCRYPT_HASH_STATE scHash;
BOOLEAN isReset;
};
template<>
class HashImpState<ImpSc, AlgSha1> {
public:
SYMCRYPT_SHA1_STATE sc;
SYMCRYPT_HASH_STATE scHash;
BOOLEAN isReset;
};
template<>
class HashImpState<ImpSc, AlgSha256> {
public:
SYMCRYPT_SHA256_STATE sc;
SYMCRYPT_HASH_STATE scHash;
BOOLEAN isReset;
};
template<>
class HashImpState<ImpSc, AlgSha384> {
public:
SYMCRYPT_SHA384_STATE sc;
SYMCRYPT_HASH_STATE scHash;
BOOLEAN isReset;
};
template<>
class HashImpState<ImpSc, AlgSha512> {
public:
SYMCRYPT_SHA512_STATE sc;
SYMCRYPT_HASH_STATE scHash;
BOOLEAN isReset;
};
template<>
class ParallelHashImpState<ImpSc, AlgParallelSha256> {
public:
SYMCRYPT_SHA256_STATE sc[MAX_PARALLEL_HASH_STATES];
_Field_range_(0, MAX_PARALLEL_HASH_STATES) SIZE_T nHashes;
};
template<>
class ParallelHashImpState<ImpSc, AlgParallelSha384> {
public:
SYMCRYPT_SHA384_STATE sc[MAX_PARALLEL_HASH_STATES];
_Field_range_(0, MAX_PARALLEL_HASH_STATES) SIZE_T nHashes;
};
template<>
class ParallelHashImpState<ImpSc, AlgParallelSha512> {
public:
SYMCRYPT_SHA512_STATE sc[MAX_PARALLEL_HASH_STATES];
_Field_range_(0, MAX_PARALLEL_HASH_STATES) SIZE_T nHashes;
};
template<>
class MacImpState<ImpSc, AlgHmacMd5> {
public:
SYMCRYPT_HMAC_MD5_EXPANDED_KEY key;
SYMCRYPT_HMAC_MD5_STATE state;
};
template<>
class MacImpState<ImpSc, AlgHmacSha1> {
public:
SYMCRYPT_HMAC_SHA1_EXPANDED_KEY key;
SYMCRYPT_HMAC_SHA1_STATE state;
};
template<>
class MacImpState<ImpSc, AlgHmacSha256> {
public:
SYMCRYPT_HMAC_SHA256_EXPANDED_KEY key;
SYMCRYPT_HMAC_SHA256_STATE state;
};
template<>
class MacImpState<ImpSc, AlgHmacSha384> {
public:
SYMCRYPT_HMAC_SHA384_EXPANDED_KEY key;
SYMCRYPT_HMAC_SHA384_STATE state;
};
template<>
class MacImpState<ImpSc, AlgHmacSha512> {
public:
SYMCRYPT_HMAC_SHA512_EXPANDED_KEY key;
SYMCRYPT_HMAC_SHA512_STATE state;
};
template<>
class MacImpState<ImpSc, AlgAesCmac> {
public:
SYMCRYPT_AES_CMAC_EXPANDED_KEY key;
SYMCRYPT_AES_CMAC_STATE state;
};
template<>
class MacImpState<ImpSc, AlgMarvin32> {
public:
SYMCRYPT_MARVIN32_EXPANDED_KEY key;
SYMCRYPT_MARVIN32_STATE state;
};
template<>
class MacImpState<ImpSc, AlgPoly1305> {
public:
SYMCRYPT_POLY1305_STATE state;
};
template<class Mode>
class BlockCipherImpState< ImpSc, AlgAes, Mode> {
public:
SYMCRYPT_AES_EXPANDED_KEY key;
};
template<class Mode>
class BlockCipherImpState<ImpSc, AlgDes, Mode> {
public:
SYMCRYPT_DES_EXPANDED_KEY key;
};
template<class Mode>
class BlockCipherImpState<ImpSc, Alg2Des, Mode> {
public:
SYMCRYPT_3DES_EXPANDED_KEY key;
};
template<class Mode>
class BlockCipherImpState<ImpSc, Alg3Des, Mode> {
public:
SYMCRYPT_3DES_EXPANDED_KEY key;
};
template<class Mode>
class BlockCipherImpState<ImpSc, AlgDesx, Mode> {
public:
SYMCRYPT_DESX_EXPANDED_KEY key;
};
template<class Mode>
class BlockCipherImpState<ImpSc, AlgRc2, Mode> {
public:
SYMCRYPT_RC2_EXPANDED_KEY key;
};
template<>
class AuthEncImpState<ImpSc, AlgAes, ModeCcm> {
public:
BOOLEAN inComputation;
SYMCRYPT_AES_EXPANDED_KEY key;
SYMCRYPT_CCM_STATE ccmState;
SIZE_T totalCbData;
};
template<>
class AuthEncImpState<ImpSc, AlgAes, ModeGcm> {
public:
SYMCRYPT_GCM_EXPANDED_KEY key;
SYMCRYPT_GCM_STATE gcmState;
BOOLEAN inComputation;
SIZE_T totalCbData; // not used, but allows common code.
};
template<>
class StreamCipherImpState<ImpSc, AlgRc4> {
public:
SYMCRYPT_RC4_STATE state;
};
template<>
class StreamCipherImpState<ImpSc, AlgChaCha20> {
public:
BYTE key[32];
BYTE nonce[12];
UINT64 offset;
SYMCRYPT_CHACHA20_STATE state;
};
template<>
class RngSp800_90ImpState<ImpSc, AlgAesCtrDrbg> {
public:
SYMCRYPT_RNG_AES_STATE state;
};
template<>
class RngSp800_90ImpState<ImpSc, AlgAesCtrF142> {
public:
SYMCRYPT_RNG_AES_FIPS140_2_STATE state;
};
template<class BaseAlg>
class KdfImpState<ImpSc, AlgPbkdf2, BaseAlg> {
public:
SYMCRYPT_PBKDF2_EXPANDED_KEY key;
};
template<class BaseAlg>
class KdfImpState<ImpSc, AlgSp800_108, BaseAlg> {
public:
SYMCRYPT_SP800_108_EXPANDED_KEY key;
};
template<class BaseAlg>
class KdfImpState<ImpSc, AlgTlsPrf1_1, BaseAlg> {
public:
SYMCRYPT_TLSPRF1_1_EXPANDED_KEY key;
};
template<class BaseAlg>
class KdfImpState<ImpSc, AlgTlsPrf1_2, BaseAlg> {
public:
SYMCRYPT_TLSPRF1_2_EXPANDED_KEY key;
};
template<class BaseAlg>
class KdfImpState<ImpSc, AlgHkdf, BaseAlg> {
public:
SYMCRYPT_HKDF_EXPANDED_KEY key;
};
template<>
class XtsImpState<ImpSc, AlgXtsAes> {
public:
SYMCRYPT_XTS_AES_EXPANDED_KEY key;
};

Просмотреть файл

@ -0,0 +1,64 @@
//
// Selftestfunclist.cpp
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Array of self test functions.
// This is in a separate file so that the Kernel test program can include
// it directly, and we only have to keep a single list.
//
// The Kernel mode code cannot link to the primary lib or compile the precomp.h
// header file because the /kernel flag is required for kernel-mode code, and
// it is not compatible with C++ exceptions used in the STL.
//
VOID
SYMCRYPT_CALL
SymCryptAesSelftestVoid()
{
SymCryptAesSelftest( SYMCRYPT_AES_SELFTEST_ALL );
}
const SELFTEST_INFO g_selfTests[] =
{
{&SymCryptMd2Selftest, "Md2"},
{&SymCryptMd4Selftest, "Md4"},
{&SymCryptMd5Selftest, "Md5"},
{&SymCryptSha1Selftest, "Sha1"},
{&SymCryptSha256Selftest, "Sha256"},
{&SymCryptSha384Selftest, "Sha384"},
{&SymCryptSha512Selftest, "Sha512"},
{&SymCryptHmacMd5Selftest, "HmacMd5" },
{&SymCryptHmacSha1Selftest, "HmacSha1" },
{&SymCryptHmacSha256Selftest, "HmacSha256" },
{&SymCryptHmacSha384Selftest, "HmacSha384" },
{&SymCryptHmacSha512Selftest, "HmacSha512" },
{&SymCryptAesCmacSelftest, "AesCmac" },
{&SymCryptMarvin32Selftest, "Marvin32" },
{&SymCryptAesSelftestVoid, "Aes" },
{&SymCryptDesSelftest, "Des" },
{&SymCrypt3DesSelftest, "3Des" },
{&SymCryptDesxSelftest, "Desx" },
{&SymCryptRc2Selftest, "Rc2" },
{&SymCryptCcmSelftest, "Ccm" },
{&SymCryptGcmSelftest, "Gcm" },
{&SymCryptRc4Selftest, "Rc4" },
{&SymCryptRngAesInstantiateSelftest, "AesCtrDrbgInstantiate" },
{&SymCryptRngAesReseedSelftest, "AesCtrDrbgReseed" },
{&SymCryptRngAesGenerateSelftest, "AesCtrDrbgGenerate"},
{&SymCryptPbkdf2_HmacSha1SelfTest, "Pbkdf2_HmacSha1"},
{&SymCryptPbkdf2_HmacSha256SelfTest, "Pbkdf2_HmacSha256"},
{&SymCryptSp800_108_HmacSha1SelfTest, "SP800-108_HmacSha1" },
{&SymCryptSp800_108_HmacSha256SelfTest, "SP800-108_HmacSha256" },
{&SymCryptTlsPrf1_1SelfTest, "TLS PRF 1.1" },
{&SymCryptTlsPrf1_2SelfTest, "TLS PRF 1.2" },
{&SymCryptHkdfSelfTest, "HKDF" },
{&SymCryptXtsAesSelftest, "Xts-Aes" },
{&SymCryptParallelSha256Selftest, "ParallelSha256" },
{&SymCryptParallelSha384Selftest, "ParallelSha384" },
{&SymCryptParallelSha512Selftest, "ParallelSha512" },
{NULL, NULL},
};

233
unittest/inc/testInterop.h Normal file
Просмотреть файл

@ -0,0 +1,233 @@
//
// testInterop.h Header file for SymCrypt RSA, DSA, and DH Interop tests
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "sc_implementations.h"
#include "msbignum_implementations.h"
#include "bigpriv.h"
#include "ms_rsa.h"
#include "cryptdsa.h"
#include "cryptdh.h"
#include "cng_implementations.h"
#define IMPSC_INDEX (0)
#define IMPMSBIGNUM_INDEX (1)
#define IMPCNG_INDEX (2)
typedef struct _IMPLEMENTATION_DATA {
char * name;
UINT32 index;
} IMPLEMENTATION_DATA;
#define TEST_INTEROP_NUMOF_IMPS (3)
extern IMPLEMENTATION_DATA g_Implementations[TEST_INTEROP_NUMOF_IMPS];
typedef struct _HASHALG_DATA {
PCSYMCRYPT_HASH pHashAlgorithm;
LPCSTR shortName;
LPCWSTR cngName;
pfnHash msBignumHashFunc;
} HASHALG_DATA;
#define TEST_INTEROP_NUMOF_HASHALGS (5)
extern HASHALG_DATA g_HashAlgs[TEST_INTEROP_NUMOF_HASHALGS];
// Helper functions
UINT32 testInteropImplToInd( AlgorithmImplementation * pImpl );
VOID testInteropScToHashContext( PCSYMCRYPT_HASH pHashAlgorithm, PBYTE rgbDigest, hash_function_context* pHashFunCxt);
LPCWSTR testInteropScToCngHash( PSYMCRYPT_HASH pHashAlgorithm );
PCSYMCRYPT_HASH testInteropRandomHash();
LPCSTR testInteropHashAlgToString( PCSYMCRYPT_HASH pHashAlgorithm );
VOID testInteropReverseMemCopy( PBYTE pbDst, PBYTE pbSrc, SIZE_T cbSrc );
//
// Algorithm implementations
//
// Function for randomizing inputs of algorithms
typedef VOID (*InteropRandFn )(
PBYTE pKeyEntry,
PBYTE pbBufferA,
SIZE_T* pcbBufferA,
PBYTE pbBufferB,
SIZE_T* pcbBufferB,
PBYTE pbBufferC,
SIZE_T* pcbBufferC,
PCSYMCRYPT_HASH* ppHashAlgorithm );
// Encryption / Decryption / Signing / Verify / Secret agreement
typedef VOID (*InteropDataFn )(
PBYTE pKeyEntry,
PBYTE pbBufferA,
SIZE_T cbBufferA,
PBYTE pbBufferB,
SIZE_T cbBufferB,
PBYTE pbBufferC,
SIZE_T cbBufferC,
PCSYMCRYPT_HASH pHashAlgorithm );
// FunctionalInteropImplementation class is only used for functional tests of RSA
class FunctionalInteropImplementation: public AlgorithmImplementation
{
public:
FunctionalInteropImplementation() {};
virtual ~FunctionalInteropImplementation() {};
private:
FunctionalInteropImplementation( const FunctionalInteropImplementation & );
VOID operator=( const FunctionalInteropImplementation & );
public:
InteropRandFn m_RandFunction;
InteropDataFn m_QueryFunction;
InteropDataFn m_ReplyFunction;
};
// FunctionalInteropImp class is the template class of FunctionalInteropImplementation
template< class Implementation, class Algorithm>
class FunctionalInteropImp: public FunctionalInteropImplementation
{
public:
FunctionalInteropImp();
virtual ~FunctionalInteropImp();
private:
FunctionalInteropImp( const FunctionalInteropImp & );
VOID operator=( const FunctionalInteropImp & );
public:
static const String s_impName;
static const String s_modeName;
static const String s_algName;
};
template< class Implementation, class Algorithm>
const String FunctionalInteropImp<Implementation, Algorithm>::s_impName = Implementation::name;
template< class Implementation, class Algorithm>
const String FunctionalInteropImp<Implementation, Algorithm>::s_algName = Algorithm::name;
template< class Implementation, class Algorithm>
const String FunctionalInteropImp<Implementation, Algorithm>::s_modeName;
//
// Interop functions
//
// Function that generates random key(s) on one implementation and stores them into a key entry
template< class Implementation > VOID algImpTestInteropGenerateKeyEntry(PBYTE pKeyEntry);
// Function that fills the key entry buffers with the group/key material
template< class Implementation > VOID algImpTestInteropFillKeyEntryBuffers(PBYTE pKeyEntry);
// Function that creates the keys on one implementation from the key entry buffers
template< class Implementation > VOID algImpTestInteropImportKeyEntryBuffers(PBYTE pKeyEntry);
// Function that cleans the key entry on one implementation (by deallocating memory etc.)
template< class Implementation > VOID algImpTestInteropCleanKeyEntry(PBYTE pKeyEntry);
template< class Implementation, class Algorithm >
VOID algImpTestInteropRandFunction(
PBYTE pKeyEntry,
PBYTE pbBufferA,
SIZE_T* pcbBufferA,
PBYTE pbBufferB,
SIZE_T* pcbBufferB,
PBYTE pbBufferC,
SIZE_T* pcbBufferC,
PCSYMCRYPT_HASH* ppHashAlgorithm );
template< class Implementation, class Algorithm >
VOID algImpTestInteropQueryFunction(
PBYTE pKeyEntry,
PBYTE pbBufferA,
SIZE_T cbBufferA,
PBYTE pbBufferB,
SIZE_T cbBufferB,
PBYTE pbBufferC,
SIZE_T cbBufferC,
PCSYMCRYPT_HASH pHashAlgorithm );
template< class Implementation, class Algorithm >
VOID algImpTestInteropReplyFunction(
PBYTE pKeyEntry,
PBYTE pbBufferA,
SIZE_T cbBufferA,
PBYTE pbBufferB,
SIZE_T cbBufferB,
PBYTE pbBufferC,
SIZE_T cbBufferC,
PCSYMCRYPT_HASH pHashAlgorithm );
// DL GROUPS - DSA - DH
#define TEST_DL_MAX_NUMOF_BITS (2048)
#define TEST_DL_MAX_NUMOF_BYTES (TEST_DL_MAX_NUMOF_BITS/8)
typedef struct {
UINT32 nBitsOfP;
UINT32 nBitsOfQ;
} TEST_DL_BITSIZEENTRY, * PTEST_DL_BITSIZEENTRY;
typedef struct {
UINT32 nBitsOfP;
UINT32 cbPrimeP;
UINT32 nBitsOfQ;
UINT32 cbPrimeQ;
UINT32 nBitsOfQSet; // This can be 0 if initialized by 0 (SymCrypt calls them like this)
SYMCRYPT_DLGROUP_FIPS
eFipsStandard; // Specified FIPS standard
// Buffers of parameters
BYTE rbPrimeP[TEST_DL_MAX_NUMOF_BYTES]; // Buffer that holds prime P in MSB_FIRST format (size: cbPrimeP)
BYTE rbPrimeQ[TEST_DL_MAX_NUMOF_BYTES]; // Buffer that holds prime Q in MSB_FIRST format (size: cbPrimeQ)
BYTE rbGenG[TEST_DL_MAX_NUMOF_BYTES]; // Buffer that holds the generator G in MSB_FIRST format (size: cbPrimeP)
PCSYMCRYPT_HASH pHashAlgorithm; // Hash algorithm used in FIPS generation
BYTE rbSeed[TEST_DL_MAX_NUMOF_BYTES]; // Buffer that holds the seed used in FIPS generation (size: cbPrimeQ)
UINT32 dwGenCounter; // Counter used in FIPS generation
BYTE rbPublicKeyA[TEST_DL_MAX_NUMOF_BYTES]; // Public part for the DSA key and the first DH key (size: cbPrimeP)
BYTE rbPrivateKeyA[TEST_DL_MAX_NUMOF_BYTES]; // Private part for the DSA key and the first DH key (size: cbPrimeQ) (Always of small size)
BYTE rbPublicKeyB[TEST_DL_MAX_NUMOF_BYTES]; // Public part for the second DH key (size: cbPrimeP)
BYTE rbPrivateKeyB[TEST_DL_MAX_NUMOF_BYTES]; // Private part for the second DH key (size: cbPrivateKeyB) **CNG generates a bigger key
UINT32 cbPrivateKeyB; // See above
// Pointers to objects
PBYTE pGroups[TEST_INTEROP_NUMOF_IMPS]; // Pointers to the DL group structures (only used for SymCrypt)
PBYTE pKeysDsa[TEST_INTEROP_NUMOF_IMPS]; // Pointers to the DSA keys
PBYTE pKeysDhA[TEST_INTEROP_NUMOF_IMPS]; // Pointers to the first DH keys (**in SymCrypt these are the same pointers as the above)
PBYTE pKeysDhB[TEST_INTEROP_NUMOF_IMPS]; // Pointers to the second DH keys
} TEST_DL_KEYENTRY, * PTEST_DL_KEYENTRY;

153
unittest/inc/testRsa.h Normal file
Просмотреть файл

@ -0,0 +1,153 @@
//
// testRsa.h Header file for SymCrypt RSA tests
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
#include "sc_implementations.h"
#include "msbignum_implementations.h"
#include "bigpriv.h"
#include "ms_rsa.h"
#include "cng_implementations.h"
#define TEST_RSA_MIN_NUMOF_BYTES (64) // Cng does not accept less than 512 bits (not even imported keys)
#define TEST_RSA_MAX_NUMOF_BYTES (256)
#define TEST_RSA_NUMOF_IMPS (3) // SymCrypt, MsBignum, Cng
#define TEST_RSA_MIN_NUMOF_PRIME_BITS (64) // Minimum size of bits for each prime
typedef struct {
UINT32 nBitsOfModulus;
BOOLEAN fUneqSizedPrimes;
} TEST_RSA_BITSIZEENTRY, * PTEST_RSA_BITSIZEENTRY;
//
// Each entry will hold the same key in all implementations
//
typedef struct {
UINT32 bitSize;
UINT32 keySize;
PBYTE pKeys[TEST_RSA_NUMOF_IMPS]; // Pointers to the RSA keys
} TEST_RSA_KEYENTRY, * PTEST_RSA_KEYENTRY;
// Number of bytes that have to be subtracted from the
// full modulus size to give the available space for the message.
// Exceptions:
// - For PKCS1 sign we should also subtract the cbHashOIDs size
#define TEST_RSA_PKCS1_ENC_LESS_BYTES (11)
#define TEST_RSA_OAEP_LESS_BYTES( _hashSize ) (2*(_hashSize) + 2)
#define TEST_RSA_PKCS1_SIGN_LESS_BYTES (17)
#define TEST_RSA_PSS_LESS_BYTES (2)
LPCWSTR testRsaScToCngHash( PSYMCRYPT_HASH pHashAlgorithm );
PSYMCRYPT_HASH testRsaRandomHash();
VOID testRsaGetCngOidList(
PSYMCRYPT_HASH pHashAlgorithm,
PBYTE pbOut,
SIZE_T cbOut,
SIZE_T * pcbOut );
//
// Algorithm implementations
//
// Function for randomizing inputs of algorithms
typedef VOID (*FuncRandFn )(
UINT32 keySize, // Size of the key
PBYTE pbSrc, // Buffer of TEST_RSA_MAX_NUMOF_BYTES bytes that will store the message
SIZE_T* pcbSrc, // Actual size of the Src buffer that will be used
SIZE_T* pcbDst, // Actual size of the Dst buffer that will be used
PBYTE pbExtra, // Buffer of TEST_RSA_MAX_NUMOF_BYTES bytes that will store the label or the OID
SIZE_T* cbExtra, // Actual size of the label or the OIDs
PSYMCRYPT_HASH* ppHashAlgorithm // A random hash algorithm when needed
);
// Encryption / Decryption / Signing / Verify function
typedef VOID (*FuncDataFn )(
UINT32 keySize,
PBYTE pkKey,
PBYTE pbSrc,
SIZE_T cbSrc,
PBYTE pbDst,
SIZE_T cbDst,
PBYTE pbExtra,
SIZE_T cbExtra,
PSYMCRYPT_HASH pHashAlgorithm );
// FunctionalRsaImplementation class is only used for functional tests of RSA
class FunctionalRsaImplementation: public AlgorithmImplementation
{
public:
FunctionalRsaImplementation() {};
virtual ~FunctionalRsaImplementation() {};
private:
FunctionalRsaImplementation( const FunctionalRsaImplementation & );
VOID operator=( const FunctionalRsaImplementation & );
public:
FuncRandFn m_funcRandFunction; // Randomizing function
FuncDataFn m_funcQueryFunction; // Encryption or signing function
FuncDataFn m_funcReplyFunction; // Decryption or verifying function (this also verifies the results)
};
// FunctionalRsaImp class is the template class of FunctionalRsaImplementation
template< class Implementation, class Algorithm>
class FunctionalRsaImp: public FunctionalRsaImplementation
{
public:
FunctionalRsaImp();
virtual ~FunctionalRsaImp();
private:
FunctionalRsaImp( const FunctionalRsaImp & );
VOID operator=( const FunctionalRsaImp & );
public:
static const String s_impName;
static const String s_modeName;
static const String s_algName;
};
template< class Implementation, class Algorithm>
const String FunctionalRsaImp<Implementation, Algorithm>::s_impName = Implementation::name;
template< class Implementation, class Algorithm>
const String FunctionalRsaImp<Implementation, Algorithm>::s_algName = Algorithm::name;
template< class Implementation, class Algorithm>
const String FunctionalRsaImp<Implementation, Algorithm>::s_modeName;
template< class Implementation, class Algorithm >
VOID algImpTestRsaRandFunction(
UINT32 keySize,
PBYTE pbSrc,
SIZE_T* pcbSrc,
SIZE_T* pcbDst,
PBYTE pbExtra,
SIZE_T* pcbExtra,
PSYMCRYPT_HASH* ppHashAlgorithm );
template< class Implementation, class Algorithm >
VOID algImpTestRsaQueryFunction(
UINT32 keySize,
PBYTE pkKey,
PBYTE pbSrc,
SIZE_T cbSrc,
PBYTE pbDst,
SIZE_T cbDst,
PBYTE pbExtra,
SIZE_T cbExtra,
PSYMCRYPT_HASH pHashAlgorithm );
template< class Implementation, class Algorithm >
VOID algImpTestRsaReplyFunction(
UINT32 keySize,
PBYTE pkKey,
PBYTE pbSrc,
SIZE_T cbSrc,
PBYTE pbDst,
SIZE_T cbDst,
PBYTE pbExtra,
SIZE_T cbExtra,
PSYMCRYPT_HASH pHashAlgorithm );

1450
unittest/inc/test_lib.h Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,63 @@
#
# Known answer test vectors for IEEE 802.11 SAE Custom functions
#
# Binary data fields can be one of the following formats
# - string of hex characters
# - Double-quoted string for ASCII strings (no terminating zero is added to the data)
# - 'repeat(<int)' followed by a data field
#
[IEEE802_11SaeCustom]
# sae 2 case from OidTest.exe
password = "Admin!98"
MACa = 9cda3ef27dd5
MACb = 3413e8bc4d32
count = 2
random = 781fe26354041421e8c8e1ca5ceb4522a2d9fca6fd4fb931cdbbe0d44a3e5773
mask = e621811ddea6de28b511447fbca6375f1223a858294de7630f732151e9f52d60
commitScalar = 5e41638232aaf2499dda264a19917c81f816aa517f86020fe975376337d05f82
commitElement = b2673d35f1de77912176eb746ae3a76ecee660fa086b4693e8ac1b5af9e7386f9fbad6401c105ed947d1cb76522bb5b145969a1849c3a6ef933fec3596890294
peerScalar = d0c16dc659c85f15a5dcf37b7a64f7badcd8c5356b6bc0bda91fb90ea5d5494f
peerElement = c296950aff00f02af401e5aba24eecc219032a430524ddb5d879eaec903200ab6c9119ae493d89384c97c23c69522d2428ef4947f1002e2c324f3889b3cf1243
scalarSum = 2f02d1498c73515e43b719c593f6743d180874d943da24489edb25aee1428380
sharedSecret = 1ba49bfd41bc1a65abeb6945c4c399dc884a7d5ce6d1c4f2e5a353b1b9de37fc
# sae 3 case from OidTest.exe
password = "Admin!98"
MACa = 9cda3ef27dd5
MACb = 3413e8bc4d32
count = 2
random = 528b7eae49677a6497476100595786b23dfdd5bfadc310448db30ce5b83c91ff
mask = 91678733812acd18c8eaffdf17ca8179aa2c1a5fb96138f86bd9b0c9920ae2af
commitScalar = e3f305e1ca92477d603260df7122082be829f01f6724493cf98cbdaf4a4774ae
commitElement = 8796d7d7abe3026efb885d6fc305d02cd07d516ba8680b3cbe63493f798bda9c470fbc3ecf6efed2aaba374b8c8d8d089f960a80a4aab5a89f760c8743b7f44b
peerScalar = b529285eed665408dac46bb864820f161ad7f00326ae962cc91a5e70b6656e36
peerElement = a0190c315dbebaf4e635d6507559501121ace4e425b5368ea1e2fa75db7edcbcd9bab22174f8515161d8bff7e1e51cf521be842eb471aa0f8f070ccf8591b01b
sharedSecret = 7fd1db140f1e935db49d22eb91ee57321ce567dc95b72387a4989e49b7660d9a
scalarSum = 991c2e41b7f89b853af6cc97d5a41742461ae574e6bb40e4ceed515d0449bd93
#sae 4 case from OidTest.exe
password = "Admin!98-1"
MACa = 9cda3ef27dd5
MACb = 3413e8bc4d32
count = 3
random = d2e6ccfcf833126ae6675c3f02d9d173f822f48fc5e5d1b3d62a0e0e1cfe44a3
mask = 76755fb628b9b77f019bd0c18ad17c1d34da0c4621b5865e37560080428e7fb1
commitScalar = 495c2cb420ecc9e8e8032d008dab4d91701606284083b98d19c643cb63299f03
commitElement = 132efc90b9d7b5c12a1de9059cb3bac8a693ffbf2302423e58c20d0010e844609dfc345e988ef2126724d080fb2f1e7ae654010050d4fe664762c03c9f7a1027
peerScalar = 934889ab386b72d5ff0d3caa095650202bd03e2696b5905f7b495f3b7dc35b48
peerElement = 58545e6ca0e886effb052afb632ca2195bb0b0a825e59dba6baa0e93af046ef4c9455fec43fe5eb02a6b8abc8fd70787873dd1d5d7fde3073a4cf3c2c76f595c
sharedSecret = b6790fc6d842a66a37d8921312ff28f44b30db710d83fda1ce3a37f536c2b4dd
scalarSum = dca4b65f59583cbee71069aa97019db19be6444ed73949ec950fa306e0ecfa4b
# Neagative test case, invalid peer Element
NegativeTest = 1
peerElement = 5d901c4a9b7f11e7935adeb7a4bac40c5172604f1c1a1a42dbca4753f695aa5ad01e1f8b812f01a3631a79dab001b372a185535b77e38a46a6faeeffffffffff
# run the self-consistency checks
selfconsistent = 1

163
unittest/kat_authenc.dat Normal file
Просмотреть файл

@ -0,0 +1,163 @@
#
# Known answer test vectors for Authenticated Encryption
#
# This file format is based on the FAX files that Atlan gave us with test vectors for FIPS algorithms.
# Many of the test vectors also come from them.
#
# Binary data fields can be one of the following formats
# - string of hex characters
# - Double-quoted string for ASCII strings (no terminating zero is added to the data)
# - 'repeat(<int)' followed by a data field
#
[AesGcm]
#
# test cases from "The Galois/Counter Mode of Operation (GCM)" by David McGrew & John Viega, May 31 2005
#
# test case 1
key = 00000000000000000000000000000000
nonce= 000000000000000000000000
AuthData = ""
Plaintext = ""
Ciphertext = ""
Tag = 58e2fccefa7e3061367f1d57a4e7455a
# test case 2
key = 00000000000000000000000000000000
nonce= 000000000000000000000000
AuthData = ""
Plaintext = 00000000000000000000000000000000
Ciphertext = 0388dace60b6a392f328c2b971b2fe78
Tag = ab6e47d42cec13bdf53a67b21257bddf
# test case 3
key = feffe9928665731c6d6a8f9467308308
nonce= cafebabefacedbaddecaf888
AuthData = ""
Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
Ciphertext = 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f5985
Tag = 4d5c2af327cd64a62cf35abd2ba6fab4
# test case 4
key = feffe9928665731c6d6a8f9467308308
nonce= cafebabefacedbaddecaf888
AuthData = feedfacedeadbeeffeedfacedeadbeefabaddad2
Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
Ciphertext = 42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091
Tag = 5bc94fbc3221a5db94fae95ae7121a47
# test case 7
key = 000000000000000000000000000000000000000000000000
nonce= 000000000000000000000000
AuthData = ""
Plaintext = ""
Ciphertext = ""
Tag = cd33b28ac773f74ba00ed1f312572435
# test case 8
key = 000000000000000000000000000000000000000000000000
nonce= 000000000000000000000000
AuthData = ""
Plaintext = 00000000000000000000000000000000
Ciphertext = 98e7247c07f0fe411c267e4384b0f600
Tag = 2ff58d80033927ab8ef4d4587514f0fb
# test case 9
key = feffe9928665731c6d6a8f9467308308feffe9928665731c
nonce= cafebabefacedbaddecaf888
AuthData = ""
Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
Ciphertext = 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710acade256
Tag = 9924a7c8587336bfb118024db8674a14
# test case 10
key = feffe9928665731c6d6a8f9467308308feffe9928665731c
nonce= cafebabefacedbaddecaf888
AuthData = feedfacedeadbeeffeedfacedeadbeefabaddad2
Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
Ciphertext = 3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710
Tag = 2519498e80f1478f37ba55bd6d27618c
# test case 13
key = 0000000000000000000000000000000000000000000000000000000000000000
nonce= 000000000000000000000000
AuthData = ""
Plaintext = ""
Ciphertext = ""
Tag = 530f8afbc74536b9a963b4f1c4cb738b
# test case 14
key = 0000000000000000000000000000000000000000000000000000000000000000
nonce= 000000000000000000000000
AuthData = ""
Plaintext = 00000000000000000000000000000000
Ciphertext = cea7403d4d606b6e074ec5d3baf39d18
Tag = d0d1c8a799996bf0265b98b5d48ab919
# test case 15
key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
nonce= cafebabefacedbaddecaf888
AuthData = ""
Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255
Ciphertext = 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad
Tag = b094dac5d93471bdec1a502270e3cc6c
# test case 16
key = feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
nonce= cafebabefacedbaddecaf888
AuthData = feedfacedeadbeeffeedfacedeadbeefabaddad2
Plaintext = d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39
Ciphertext = 522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662
Tag = 76fc6ece0f4e1768cddf8853bb2d551b
rrep = 1000
rnd = f05d1f02827dc7a10c7db69614ad4fd7
[AesCcm]
# example 1 from SP 800-38c section C.1
Key = 404142434445464748494a4b4c4d4e4f
Nonce = 10111213141516
AuthData = 0001020304050607
Plaintext = 20212223
Ciphertext = 7162015b
Tag = 4dac255d
#example 2
Key = 404142434445464748494a4b4c4d4e4f
Nonce = 1011121314151617
AuthData = 000102030405060708090a0b0c0d0e0f
Plaintext = 202122232425262728292a2b2c2d2e2f
Ciphertext = d2a1f0e051ea5f62081a7792073d593d
Tag = 1fc64fbfaccd
#example 3
Key = 404142434445464748494a4b4c4d4e4f
Nonce = 101112131415161718191a1b
AuthData = 000102030405060708090a0b0c0d0e0f10111213
Plaintext = 202122232425262728292a2b2c2d2e2f3031323334353637
Ciphertext = e3b201a9f5b71a7a9b1ceaeccd97e70b6176aad9a4428aa5
Tag = 484392fbc1b09951
#example 4
Key = 404142434445464748494a4b4c4d4e4f
Nonce = 101112131415161718191a1b1c
AuthData = repeat( 256 ) 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
Plaintext = 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f
Ciphertext = 69915dad1e84c6376a68c2967e4dab615ae0fd1faec44cc484828529463ccf72
Tag = b4ac6bec93e8598e7f0dadbcea5b
#
# test vectors from Atlan
# *** TODO ***
# Test vectors need some code to convert them to our unified format.
#
rrep = 1000
rnd = ce7c7df92c0bfc567814477cbfe48588

7195
unittest/kat_blockcipher.dat Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

7248
unittest/kat_ecdsa.dat Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

1840
unittest/kat_hash.dat Normal file

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

3258
unittest/kat_hash_long.dat Normal file

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

730
unittest/kat_kdf.dat Normal file
Просмотреть файл

@ -0,0 +1,730 @@
#
#Known answer test vectors for RNG algorithms
#
# This file format is based on the FAX files that Atlan gave us with test vectors for FIPS algorithms.
# Many of the test vectors also come from them.
#
# Binary data fields can be one of the following formats
# - string of hex characters
# - Double-quoted string for ASCII strings (no terminating zero is added to the data)
# - 'repeat(<int)' followed by a data field
#
[Pbkdf2HmacMd5]
# random key s in size 0..256
rrep = 1000
argtype = 1
keylen = 0x01000100
rnd = bb55242eb3f77de71a316668
# random keys in size 0..256
rrep = 1000
argtype = 2
keylen = 0x01000100
rnd = d9df5a74f744834b9eaf5894
[Pbkdf2HmacSha1]
# from RFC 6070
key = "password"
salt = "salt"
iterationCnt = 1
res = 0c60c80f961f0e71f3a9b524af6012062fe037a6
key = "password"
salt = "salt"
iterationCnt = 2
res = ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957
key = "password"
salt = "salt"
iterationCnt = 4096
res = 4b007901b765489abead49d926f721d065a429c1
#key = "password"
#salt = "salt"
#iterationCnt = 16777216
#res = eefe3d61cd4da4e4e9945b3d6ba2158c2634e984
key = "passwordPASSWORDpassword"
salt = "saltSALTsaltSALTsaltSALTsaltSALTsalt"
iterationCnt = 4096
res = 3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038
# key = "pass\0word", salt = "sa\0lt"
#key = 7061737300776f7264
#salt = 7361006b74
#iterationCnt = 4096
#res = 56fa6aa75548099dcc37d7f03425e0c3
# random key s in size 0..256
rrep = 5000
argtype = 1
keylen = 0x01000100
rnd = 8878da5d4c970808aae64270
# random keys in size 0..256
rrep = 5000
argtype = 2
keylen = 0x01000100
rnd = 712e1c0e2c4ca2b9a33ba95a
[Pbkdf2HmacSha256]
# from http://pastebin.com/vHyyiwmV
key = "password"
salt = "salt"
iterationCnt = 1
res = 120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b
key = "password"
salt = "salt"
iterationCnt = 2
res = ae4d0c95af6b46d32d0adff928f06dd02a303f8ef3c251dfd6e2d85a95474c43
key = "password"
salt = "salt"
iterationCnt = 4096
res = c5e478d59288c841aa530db6845c4c8d962893a001ce4e11a4963873aa98134a
#key = "password"
#salt = "salt"
#iterationCnt = 16777216
#res = cf81c66fe8cfc04d1f31ecb65dab4089f7f179e89b3b0bcb17ad10e3ac6eba46
key = "passwordPASSWORDpassword"
salt = "saltSALTsaltSALTsaltSALTsaltSALTsalt"
iterationCnt = 4096
res = 348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c4e2a1fb8dd53e1c635518c7dac47e9
# key = "pass\0word", salt = "sa\0lt", might be wrong interpretation of the HTML page though...
#key = 7061737300776f7264
#salt = 7361006b74
#iterationCnt = 4096
#res = 89b69d0516f829893c696226650a8687
key = "password"
salt = "salt"
iterationCnt = 1
res = 120fb6cffcf8b32c43e7225256c4f837a86548c9
key = "passwordPASSWORDpassword"
salt = "saltSALTsaltSALTsaltSALTsaltSALTsalt"
iterationCnt = 4096
res = 348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c
# random key s in size 0..256
rrep = 5000
argtype = 1
keylen = 0x01000100
rnd = 3f96e0a77f099ff59cd89acd
# random keys in size 0..256
rrep = 5000
argtype = 2
keylen = 0x01000100
rnd = c30900033d1a2f70c8f7ad29
[Pbkdf2HmacSha384]
# random key s in size 0..256
rrep = 1000
argtype = 1
keylen = 0x01000100
rnd = 8c50da14bea5ed292461ec7d
# random keys in size 0..256
rrep = 1000
argtype = 2
keylen = 0x01000100
rnd = d82dc4852c91af62996a84f3
[Pbkdf2HmacSha512]
# random key s in size 0..256
rrep = 1000
argtype = 1
keylen = 0x01000100
rnd = c52cd328eafaa851b2250366
# random keys in size 0..256
rrep = 1000
argtype = 2
keylen = 0x01000100
rnd = 1c61bcf030b502e4642f7bbe
[Pbkdf2AesCmac]
rrep = 1000
argtype = 1
keylen = 16
rnd = 11641082963b54670c368e00
# random keys in size 0..256
rrep = 1000
argtype = 2
keylen = 32
rnd = 48f7450ab3e95c32a1433cd6
# From cng_bvt tests (uses WCHARs)
# key = "T\0E\0S\0T\0_\0K\0D\0F\0"
# salt = "T\0E\0S\0T\0_\0K\0D\0F\0_\0S\0A\0L\0T\0"
key = 54004500530054005f004b0044004600
salt = 54004500530054005f004b00440046005f00530041004c005400
iterationCnt = 128
res = 58d782b5d2639d423d7853f294189113
[Sp800_108HmacMd5]
# random keys in size 0..256
rrep = 1000
argtype = 1
keylen = 0x01000100
rnd = ab6637f472e5fe7b2c138b8d
rrep = 1000
argtype = 3
keylen = 0x01000100
rnd = d516632a06801cebde41ce0f
[Sp800_108HmacSha1]
# random keys in size 0..256
rrep = 1000
argtype = 1
keylen = 0x01000100
rnd = 39dd26552ac354951c537e5e
rrep = 1000
argtype = 3
keylen = 0x01000100
rnd = c8fff4996f8f98894344642f
[Sp800_108HmacSha256]
# random keys in size 0..256
rrep = 1000
argtype = 1
keylen = 0x01000100
rnd = eed46c702cf53e9894f15485
rrep = 1000
argtype = 3
keylen = 0x01000100
rnd = 3c53de73f2c1b20bf108301f
[Sp800_108HmacSha384]
# random keys in size 0..256
rrep = 1000
argtype = 1
keylen = 0x01000100
rnd = ef9eaaae148bdd2eb47f69fc
rrep = 1000
argtype = 3
keylen = 0x01000100
rnd = febe4fce472c101463d29990
[Sp800_108HmacSha512]
# random keys in size 0..256
rrep = 1000
argtype = 1
keylen = 0x01000100
rnd = 7c7989109dc42ed0f1aab132
rrep = 1000
argtype = 3
keylen = 0x01000100
rnd = 1fada23721703694b6812810
[Sp800_108AesCmac]
# random keys in size 0..256
rrep = 1000
argtype = 1
keylen = 16
rnd = a4a330a20b2dcc0e2ee64083
rrep = 1000
argtype = 3
keylen = 32
rnd = 78fd546594fc1858d35dd41f
# FIPS Test Vectors for the TLS KDF
#[TLS 1.0/1.1]
#[pre-master secret length = 384]
#[key block length = 832]
[TlsPrf1_1HmacMd5]
COUNT = 0
pre_master_secret = bded7fa5c1699c010be23dd06ada3a48349f21e5f86263d512c0c5cc379f0e780ec55d9844b2f1db02a96453513568d0
serverHello_random = 135e4d557fdf3aa6406d82975d5c606a9734c9334b42136e96990fbd5358cdb2
clientHello_random = e5acaf549cd25c22d964c0d930fa4b5261d2507fad84c33715b7b9a864020693
server_random = 67267e650eb32444119d222a368c191af3082888dc35afe8368e638c828874be
client_random = d58a7b1cd4fedaa232159df652ce188f9d997e061b9bf48e83b62990440931f6
master_secret = 2f6962dfbc744c4b2138bb6b3d33054c5ecc14f24851d9896395a44ab3964efc2090c5bf51a0891209f46c1e1e998f62
key_block = 3088825988e77fce68d19f756e18e43eb7fe672433504feaf99b3c503d9091b164f166db301d70c9fc0870b4a94563907bee1a61fb786cb717576890bcc51cb9ead97e01d0a2fea99c953377b195205ff07b369589178796edc963fd80fdbe518a2fc1c35c18ae8d
COUNT = 1
pre_master_secret = 2a63fc315176b2148604263e2efbc3b51269b899bc0c26ef6f5e1392d4305cd1b4e2a873cb2e4a3b9ae54b46361d77e3
serverHello_random = a27d758b700b1fd301e293cd7fceceed59580590a92893de05dc0ed07cb30f34
clientHello_random = d9c5171a11719f7b411fe90dccd0e5d34d40a1f6a064600b88e1a6e03a05c49b
server_random = e0fcd224616679cf9b437c566705052a2a846ae295d06cdd30dc11aae51d8512
client_random = d2daac9e23b03832a9ec3378862e5d9fd5ed96194659252b9e3ed46af9632f42
master_secret = 4d2358abf1396fd5270ab11e9a93305a8aa9bfe51628f823a76d240443b31a05c5cd44ecdfdf2fa1a4d8f209b06153a6
key_block = 34134f49603f314e3c1183a78f1d12fb94e699402112bb29f1f54c2581a781fd8950ddd2166c348ce9841ab6e6213c9a7700669a53dc68a0d2aac11d65e7e4552531c2ea267c7b595335b81efe370608773008ee491a402b03cae19a5ce6eee10e4cb611cee34a0e
COUNT = 2
pre_master_secret = 4f837e583bae8ac2d64f2e0e354be9e593e5f772f337f945fd9c8d90259bc90ff8d9b8e4920381ee2db6c8d5418bed1b
serverHello_random = 9cc4c1fb0dbc33836cadce7a727f5d55d0c429c42cdd99ac2d88b64171b50dff
clientHello_random = 41c251377f8c666e9ec7b2b78a0f84e1309baede339e6e8d69819d6c51e1ff5c
server_random = 38bb673f07eb1e4f019cbe69f27f46e4f14e42b89d5c3ac2a31e25c9f72f47b4
client_random = c310396390b643d9d6864e563a0863b617f77ab1c18b7e1d94143025ed5c9b92
master_secret = bf35ff019b1b1aab12674f00dae08edfbc6f1d3012e291abf194cd762a8b4bdfe191c3ac41f402a40278d77cc2c26d38
key_block = f50640548512e816f699e3f18e0e2a18515a372978d0fb4c4aa4a405c86838dc948f1104ab4fe1a575359b60f8551adacb7949968e5633a06c7e4e447bf33817b5e1c952e8d7e7363e80edbc21c07f5ae46a6f9f2da74f6f217275cc8e99bae7efa03577034b8179
COUNT = 3
pre_master_secret = 86051948e4d9a0cd273b6cd3a76557fc695e2ad9517cda97081ed009588a20ab48d0b128de8f917da74e711879460b60
serverHello_random = 55f1f273d4cdd4abb97f6856ed10f83a799dc42403c3f60c4e504419db4fd727
clientHello_random = 0b71e1f7232e675112510cf654a5e6280b3bd8ff078b67ec55276bfaddb92075
server_random = a62615ee7fee41993588b2542735f90910c5a0f9c5dcb64898fdf3e90dc72a5f
client_random = 7798a130b732d7789e59a5fc14ad331ae91199f7d122e7fd4a594036b0694873
master_secret = 37841ef801f8cbdb49b6a164025de3e0ea8169604ffe80bd98b45cdd34105251cedac7223045ff4c7b67c8a12bf3141c
key_block = c520e2409fa54facd3da01910f50a28f2f50986beb56b0c7b4cee9122e8f7428b7f7b8277bda931c71d35fdc2ea92127a5a143f63fe145275af5bcdab26113deffbb87a67f965b3964ea1ca29df1841c1708e6f42aacd87c12c4471913f61bb994fe3790b735dd11
COUNT = 4
pre_master_secret = c1553d58e3f448ea0931fa956e4dacaf7a36a600726ca00f5fe3765dda46aa60532944debd41218453577548ca5a182b
serverHello_random = f65c9d09d7f287d653d04966e00a3e0d9923f8186b5d9a85d3a9078571756a05
clientHello_random = 60c999faddcd570ebfec2a1c5c7cba9717d16dc35301e25a29509aa49a888405
server_random = c8270018c82732a26ff1c0206a7c9ce83be0359e8c18e868957803b5b1d35ec9
client_random = 0896407b67189bb3952d2cddc471d4d88f8b1ad9a3cb2fb245217781bb070398
master_secret = 346673a1bb47a43b625be4c687b9894c5cfcbeb73e1e9e6fd891d0b0168ed25dfca469cf37eac007c6b9c1b3f7c17ce4
key_block = db969b07ef962133512f65d1c9a58a3c8dd8ff3c2ed5d693cd48c6e66165771d378fb5252fd58a634923f022cbaf3d81f93bbf777cc6feb7a7a931f25dec2b595cd9295eb8487cc332e7fe2423daa49d3690e0ec921d64dc9e29971444231b6e3969219ec95ce8ee
COUNT = 5
pre_master_secret = f61dc5feb5b8a69af3e02dad131e78d3d34afb2bc9a527f7ff3ecf0dab108fbb51c817987061bca9657ec731b8363dcb
serverHello_random = 7fe673f53133e210201a85fbd12e04085bb5748fba589b213b3dfac4cbc2e060
clientHello_random = 060f62bfe2b9ceecb713f00927314d547fa2fce912731dc09d20a4a4c6e56716
server_random = 73fac330e43744a9344f0a81dad262c13b288791e28f19a283e9e55ed5448acc
client_random = a23b0c2b07f8ba29eda3b24513d43f7604a9c3bae0bcc18223cf08b7c9a949c5
master_secret = eb672534ccd44947aff15d117a997e020355a6e71004b2c9435e649752ed30738504fc9f3b7e4e48a1f024757ba6dac5
key_block = 29a5f2d0559203963a32ce1cc66598018abe5694903fc5039f4dca38d2df95f0d6a04b5c291c5f12be775e7d2cbba062cb96d1837860e78884bbd55b9fd29df718a84087a4586d6fbe99632eda1bce6a0f34f7a9f1d36cf8c8526c3f63b0cc7cb2e8a327f7b5c902
COUNT = 6
pre_master_secret = 8360ccfd90a7413cedea3f74917f442e776cc98721bf24c079f621fc98d07db2e531194832a24a77ee6cb702fcc51109
serverHello_random = b983fd8093fcd068ed278ebb23633a6a5ef528c69a7aca0aad2922e1ba00e3ac
clientHello_random = 5e0a39954c3e7ddb4b2a8b1f39a7007fb52bef86988abc9a0611c080b9bf9628
server_random = aba07a7c23c341b03fa1fa014ecf373259c901c6c2fd9aab705df8df19be3f23
client_random = 8042358286ea496b96fea93ea9ae8d33ec2289ec4009bc894d065e4284ea5baf
master_secret = a152d579c64f77a97ee4ceeda08c0a25a4199a2bbf4e166f63aa6af53379227a4753e92889436a55d82e67ad408da285
key_block = 60498f4ef1b3f00fdfd9b4d4c915180ad2b24067e25b44dd1a494e14314888bda5dac91e055a8d1480234c7f89b46e33487fd63a5a81b4e923510a6019d1810e1ac9de58c7f7442738104a6f358d780e99fa5ea970177bad73a9fd4d70e7a778959756cbcbe79fa9
COUNT = 7
pre_master_secret = f7ca6df371dbc0ace6ddba008480b5105867aa5e244c7e297ddabedc690b6a14255df53f2a9b7b77d2278d435f05c232
serverHello_random = b28a30b86e318909e9e7ed2171a3009d37cbfc82415537040f5cc1c45c1b1f88
clientHello_random = 2edd99da86d651ff908ba7d4ce524791815457b28b09480c934ff7d360655410
server_random = 2ffb00bb2050bae4445c3e02994de6c8695fc0abdcb6ebc9746c2ccc489e6250
client_random = 1aa2da939302fb2874e7b9c555fd231941fef84c42f72f1b18944c9be154a303
master_secret = 627c92b23e63348ee641345b1811b09e541d14b416c7d1a541685475d79d727cc8ddc279d240c255f9da8960c69a1422
key_block = 3b6905f9b1d0bb6bd4e1affe6d4683abc1f81bd47baaab342c55bd403007b4981109a7650b372bf1e029d38b62371523811c393f451385efa4ec58c1e6067726badeaaad33c7bbf423fd79a0975e6dac2b6a421688128d15754448f2c11deda6e9be25ac8f30addc
COUNT = 8
pre_master_secret = 4f9d8117b32534aea9b372b37e6f14c69b92ab46a7dfbd84cf40ead01ffd0b5457101b26f84f77e33ada36fb3a66102d
serverHello_random = cbe1e622456dc1e7134077ed216b604b5da843cd6881e280100b0c1a16917d7f
clientHello_random = 9e9410bd307a6269b8d2bf2635a2abdacb6e3de25e06841ea84902b401284f4d
server_random = 7f3b93d1b67064975b273c73945e884eaa1604601e795183b8842df8ab398e7f
client_random = fa9c817f673cfc480b8927151c578d97e6ab0153aaf7cab840e16bc73b286df6
master_secret = 836381369314505a825787e827738d644284909f205f6383cc294b056aea8f1cce394ed0ca30b096094992362663787e
key_block = 5f7ca3799b135974b93e340517962153cab1dab4b5d82db3d8e05b5069f28b8fb08ae2d9fff4c08c1db56e71e16b659883076cb2c0068f9b42b975a2e708e4552b72c8ee0fa8a321241df0aac03a8c7973b0fc0e090088873a2a55b10709d3eb65e356b07b2951ab
COUNT = 9
pre_master_secret = f00c38deb2dfefd14923e38558b3310a9ab858480a4c544558b775334eb87d2cec199aea0e1d6fd9a66da8ecb33e055e
serverHello_random = d49844bffaa631a659109d086a0cbe43359e34c0b08f4719b9bf522f51746fb8
clientHello_random = 17207bc9b7b233cc8ec46fde3bcb4abfde1d68fd35ca9065fc83b6207d8b03cd
server_random = 3ff0e293bc960a79ffd441f62c87f156b71c3e8240bc49ae8b9bdfcfdaf92037
client_random = 807a9afded845149583a1bd8e37865b7ecec7ed94bc61d64e87bc520d527b46a
master_secret = 7b59ca48c69d33a3fa727e6d0a6ca68bfe9a8146b160ed8e2ebe8827a0e1dc848fb783be2cbf4c030b61926e53bb56e0
key_block = f2e6aae413c3e7d2ff3a74b056866a3fea1c8b030853c0c5cf7f6c91d0342c9c6bd9bc8b4bfddca44580db9743f75f4bf0ab15d36c3f15f9de0b2cb8ce9060a988ef4b3b85f021d5c15b326a595ab44db176eec8e14b97c6c1899e75ef16d05f72771352e603794d
#[TLS 1.2, SHA-256]
#[pre-master secret length = 384]
#[key block length = 1024]
[TlsPrf1_2HmacSha256]
COUNT = 0
pre_master_secret = f8938ecc9edebc5030c0c6a441e213cd24e6f770a50dda07876f8d55da062bcadb386b411fd4fe4313a604fce6c17fbc
serverHello_random = f6c9575ed7ddd73e1f7d16eca115415812a43c2b747daaaae043abfb50053fce
clientHello_random = 36c129d01a3200894b9179faac589d9835d58775f9b5ea3587cb8fd0364cae8c
server_random = ae6c806f8ad4d80784549dff28a4b58fd837681a51d928c3e30ee5ff14f39868
client_random = 62e1fd91f23f558a605f28478c58cf72637b89784d959df7e946d3f07bd1b616
master_secret = 202c88c00f84a17a20027079604787461176455539e705be730890602c289a5001e34eeb3a043e5d52a65e66125188bf
key_block = d06139889fffac1e3a71865f504aa5d0d2a2e89506c6f2279b670c3e1b74f531016a2530c51a3a0f7e1d6590d0f0566b2f387f8d11fd4f731cdd572d2eae927f6f2f81410b25e6960be68985add6c38445ad9f8c64bf8068bf9a6679485d966f1ad6f68b43495b10a683755ea2b858d70ccac7ec8b053c6bd41ca299d4e51928
COUNT = 1
pre_master_secret = b9664b35350787f891966cc494cc29340fa6e7d2db0e85ef648b640129749988fcf7c49c17989b041745d768203a554e
serverHello_random = cf08c14548ac478165b03c1c08bba0ff5959a0ded3da678f03febae4a28c05cd
clientHello_random = 2bde249495f104e65b3b07cc88e940cd0d31c7ab6e3990dc253ff32826eea720
server_random = d2ec44801e16c23e9d4cfe4c5c238523860dcca2b3f7dea5409fb31fceefa713
client_random = 284806ac208958e6fff30ebf99d908cb00fc5af915a19a5b34cac30340031f65
master_secret = 918b60d280f8471784392edbb9dd1fef7a78f823672a78fdb62822707e717a6d1ef54ca58f0b3b84a6fa092eb27089dd
key_block = 1910e1496131f7ef05a7a568fffe7a3d3073e4f08500c97fce69d1c42a4ccf7553e52bc1ce84b760214f2632fee46ab0c4fb2bbe1214a560c7b041cbf4be44162d559ed8e8b34ab847f66aa5e948bef5a336d9d5c1e58b9ec4484f2024c4c453d87f1e9542556fe4f4615e2bdc20f74af7cf2311bd2a02bd415868339d50414d
COUNT = 2
pre_master_secret = 3d72d5e9646ef7b72e13fed5152f406e1e2a697daeee4f06d06dee0809d673fb23a49e23b3d89743581eb5d3ea172619
serverHello_random = 264cb1fda44e3762131d8251aa8f39a80308ab4dad6153d5af076c0011190a2d
clientHello_random = fa945b0a920a2959bef98524cb930c4a168ebf9d0f8853e05e66bb512a8bdcd7
server_random = f3b23d9557df8fd110c136adb7d22c1111621360cd3259334477afb7556bd1e2
client_random = 0ef8bd7b2ec845c1757a50638eb43350b56696973cb7f0fd4ca5337b811fc951
master_secret = 794a9637f27c39b4b544665712760d6cf1a54f5b05f809ce16297f5cf2c7dc37874fdd472302ab16c99adf5648ef154c
key_block = 04ae3b74f9a6770d654b5db2116d9b7652ee5ab023f7731509a2910d9c28862f0170f7fead6077c3544a1b75a972770840ed6c3982b3457d241a455549c0cf860410bf3678655a34e33ce3fe1be0c3e82b144323e85e6d6d16a44b6ccf14b6e68654e9d208168a3ad491390ea146b6fc1c57345536ff10c49d0053b7446834fe
COUNT = 3
pre_master_secret = 5752929f45b56fd50de0bfee06a68f13ff4a089833951053c84de732940f07cb1100c17e8866e338e5bcc5fd911e4804
serverHello_random = d0d3014066670b1c0003b82f45e130f3f60be8eaab2f07f71199de5ae9cf73d6
clientHello_random = b70779034a1a82e579075fa010a803d46a5133ca0dc84e911dfbb4bd8f15dce9
server_random = 64dc931f151f20481b1974d94b02c2d3b8100f9f9a6fa32b75c759f7e55c0b11
client_random = 781c8ce7911b303372a7d521cd3cfa9ac60d0dc021f59108404a20c2e274636d
master_secret = 90c6c091fd384c5384fef2a2cb9ab65ab69c1edeb8539d2a1354281285c277671ea82544f248dbce7a9a62748fbd119f
key_block = 63a90ddc34e66faa4059194d5a27544b2d1335cf09ca4c7c0e561a0110ea5fe06fc82d244b391f4b15797001acaa7d01fc7d353647e8f2ff071ff5d39a21659b946740a0e5aba9f991020eaa96fc0e3fceeae306428af45cec8c203938d72064a57126956a3013d75d2d251dbe1efd7e1eefc87dcce58a6e2ebf628d1508c6f8
COUNT = 4
pre_master_secret = 9857993726cf7a7696eae8301db989510134c71f43245134b0434a8e4b33f941b3cfbc39030fc469d5c6c407924287d7
serverHello_random = 560b66ade94dab52c4a4a7338da0082b374d7e046aa154d6f1930d0baad36b65
clientHello_random = a7b6b97c1814edbacabbfd4c8b1e58ce2301775075078dee0993965a331600a6
server_random = 3c39eb395b3ee4cf681772d9bf563c5bde7116688a927c8bea1d55c6f0bed7a9
client_random = d6abd02b8314daf219ead0520085999a227e3ef1218acd3dc8f1d6898ca36b3c
master_secret = 8f1f02936082d2746987155f33941d6c5b33d5e3454d855e0860915fc1a497f8a0a9d39891a7270c60303dfff98e3829
key_block = 8983d8a3a4687781f29b37a1be09db33dac94117992c996e77fb8298207e0aafea51bc829727c3488a5847348612690c3c234ea6914b15afb9f03e57f88e4388b036a57c2c59ed9a2a94bf035f4f29eeddc94bde25bb8f41b9e0c97932aaf461759e1053a884375f5563cc6f54a0102498329c2f96785e7df80f63afa3717784
COUNT = 5
pre_master_secret = 9a2ca3a9e60cb6f1686de49b1a8846499623a5ca488188a5942ed4e0d28c0e369973da5a1b9d234f538377bb10ed691f
serverHello_random = e60914092f810b6ed410fc012ea7b1194e008c062ccb08a72cb7c266b1d2ddaf
clientHello_random = 6d1d7410d7f93c0dba6d211a25840fd0160041955b95b4bf60b6a3944f2d2e7c
server_random = c84506e89c46fbde8fd3559e1f5aab76c89c7e2807d1ea228f4c4145425d0822
client_random = 6cd6970b920a765821045273ec8a853447e57572e4dc1231112dde397d4d1ceb
master_secret = b61405b0895cda65619244f3a13b1db2ce8d80ef84778a34b46f01e1fecb0f4e4e23efb1d311355d3a642ef32d7d3205
key_block = 070925afd7a8b57c92092a92786970a934414a84442c107017377255acbe39451133937cedd0bd8e64acc9dc5658156b8b72694ef23a52053dd7fc6d92a9c7811bc99d315e2b0363603add034dc4199a740d2adb96cc04742c2e1dd82d229ad4c9ace562ed6f636bf0f67dcac436ad2e14f381d3d5dc9198213b604dddbab987
COUNT = 6
pre_master_secret = eb1dff856092125555b7607f2bae617685a7a94f521b975b356e5da5cf28fe9f872d5388d6df8771d277059548b7aae6
serverHello_random = fdabbe6a2ffefa6c79ec1a78a9e57d5ce0b0c7b4ae7c132b4320326917034bd4
clientHello_random = e9b1ee9a84f81112c1cc2195969b2f6ac644216d0ec5384e607e89e8b2bb64d1
server_random = 00d2d30f3680f0ce1058ec9e1affa8d96236ea45349abbf1ef4806b401fd3f92
client_random = 59f7c42a19df4fc32c73e1c3e5e16308bd9eeedd309719ac34568872d40cd4ba
master_secret = e2b37e5c9a7a01a00ebb44e4c04e5475112db2573dcb5c6cf1e23743c9ccb94200b0e54df04ba582bba0ca064ef2abb2
key_block = 5b4c813c4baf8b20982ef1dd59f27371e3996ce6128b6340c702758cb7fc341b5009b26232e8fef13786eb92596d9548ebd1ed5d5f427e01f7fe10d22b35f21abfbcaecf0a22adc296fb4064d3db617ef91996aa4477c5fd1184dcc596e257246fd3c7bc011cdab124a4827badb8a2b6ea4e07fbba8c584e8cf6605da0a297c6
COUNT = 7
pre_master_secret = 8d4b3b54077716a695e6e16311feb61baf5343f08dff3264ee3654e4be2a1b1ae043091d0a4a74c048f014179292095c
serverHello_random = 90b176781dd59ebf1db934e115a7277ddbe48a2c57a2b0e8cb2150e510358abb
clientHello_random = 41d65c961147c32965d73e02a7b60e1899e530fb0f8d1ac9e8b21550646a9b3b
server_random = 156874a0455050811e97cacad246a581cbeebb4154db8a77659b6b03505399b6
client_random = e9286dda30267bd6bb551df24a8cd553330a7f71c7d394d9c074ef5e0a982ef5
master_secret = b54ac524c6a11efa6867edd191137c9869230d98ac1e114a6ef856baecdbe8336d3f28e615549f868d5a320b15b05bd2
key_block = abc6102d1b6a0af10abfd22583688805e3a60d05b846a2d533c9449cbf66ab976c8131a5931eb8d3fced77e7c9c7ab9f188a5caf67149dee17bdad25b4b58e34f6d279ed80af1c741c06a36521b1a609a8b7ebc58c0d9beb7d460e0d880b204a6a07042af22c1a5bfd5c665a633a45a377022c771af0f081e3ba4dcaf4c944d5
COUNT = 8
pre_master_secret = b25f541c189a0fa43e5080f2e96d256551b5bc7dc814bf9d7881f5e841957c3f696fb086c0a3572344c3762e52db7c9e
serverHello_random = f027bc29bec557d7abac8c6ce0fc99e3a8d337d2f75d6c1bec0c7d17dc8b4e6a
clientHello_random = 5aba951a7cc12641c521e24eff574f6fd11436e953c1c1bb9597787b338a4ef9
server_random = 10d160e312b34f6c23e2aa5216327bfea556f85144a8dfdd1477200289401947
client_random = 9a9b21ecef3c081a36d37e6a584a40336688c0bdd0c0c1896d963785ee2cb1f9
master_secret = 32b590d9e131cb3091cf97f123ca8127f4703a0c41cf3b86fbc05adf8dced5b1edcb8955fcde9394af91476c396159f7
key_block = 8b0d20f2b31c077b4014c908181bdeabefc71b64e2c2a8665a3209716be71d04736bec21df262a752566494608025a4b8fd3c20a38fa6aaee309a70e9db0a2ebcffdeba371c9535dbea8cf33b059a642d14abecc8b6b2ee5784416d9ce4524362ed33b9d541715c587ec021a99072c4eb41b033eae7dbfabd42387130fa3da4a
COUNT = 9
pre_master_secret = 4dc7d559a1c8f5559cfa3951b7af016ec9107e5980345ef379e18c38b0f40a91564b6c1cc4a92a9c5c0ec2e480393544
serverHello_random = 4bb4e3c67300cfc977275d02931b96ceb8be7f0563f8fbba5c3c3740ae01921e
clientHello_random = 63a017a298ce2aefdd9cd6ad9235e10e288360632bad78ec0f1585c578359593
server_random = c0530a4db134d6e0b414ac5f65c542f2eba287b34e61c8032cd861bf978ef2ad
client_random = b0bb551c8111f16c928e112dc0042ba97c58e5a1b788242324212a47f9f0eb48
master_secret = 6116f70ee944580ecc993b9bb183b573c208ec5073c53e3cf28e78939677b18999c4c0c795ce44f1a7d3da81fa2eea90
key_block = f1bdf727e8d8d84bcd42f4506762c3b1061ac35e29b010180b4ee5cb058f363ca9cf0e93673b71fcfe1b7b4c925a29beacd8027b41eea37e7461f0f2febb588d8ecc3fb7d3165c1b3f7105ad2a17e8b2df30523341c04f36a563fc4cb17a4a449fd75cb57f6ff67eb84bef49aa93d2be5fcbdb83cf2f6e05f0645d2ea0db94ff
#[TLS 1.2, SHA-384]
#[pre-master secret length = 384]
#[key block length = 1024]
[TlsPrf1_2HmacSha384]
COUNT = 0
pre_master_secret = a5e2642633f5b8c81ad3fe0c2fe3a8e5ef806b06121dd10df4bb0fe857bfdcf522558e05d2682c9a80c741a3aab1716f
serverHello_random = cb6e0b3eb02976b6466dfa9651c2919414f1648fd3a7838d02153e5bd39535b6
clientHello_random = abe4bf5527429ac8eb13574d2709e8012bd1a113c6d3b1d3aa2c3840518778ac
server_random = 1b1c8568344a65c30828e7483c0e353e2c68641c9551efae6927d9cd627a107c
client_random = 954b5fe1849c2ede177438261f099a2fcd884d001b9fe1de754364b1f6a6dd8e
master_secret = b4d49bfa87747fe815457bc3da15073d6ac73389e703079a3503c09e14bd559a5b3c7c601c7365f6ea8c68d3d9596827
key_block = 10fd89ef689c7ef033387b8a8f3e5e8e7c11f680f6bdd71fbac3246a73e98d45d03185dde686e6b2369e4503e9dc5a6d2cee3e2bf2fa3f41d3de57dff3e197c8a9d5f74cc2d277119d894f8584b07a0a5822f0bd68b3433ec6adaf5c9406c5f3ddbb71bbe17ce98f3d4d5893d3179ef369f57aad908e2bf710639100c3ce7e0c
COUNT = 1
pre_master_secret = 232a3e2a13c1d85a2fb290a63f701f5d3eaa592fa9828ee355c67e7d1aeff2939efe734cb9a860215d6d1733b7b6574f
serverHello_random = 0ee8ec33cd65274b0dc34919d944ee2c61343f64ed44189e67e2f4b760c70c79
clientHello_random = a1c148c1b0ca25075dc7fbcb6521749c4f5ac9bf1b27e5cf0fb4530d29e2c80c
server_random = c68423e2743b91bf9e2e1078bab5c5c884bd70983e0272343279e41738e943b5
client_random = dce4c7973f3b0468d944de1870025bcc130e7832fd3fbfcd40ad287b13ee28f9
master_secret = 2a1d6063b37a458b07746a7b04ed54c9ddeef5f2e488050dfb4b0f38cc5b178e3c20e6a72307efc859bd2e1c24f790c7
key_block = de9f2ce42403605743e84e71b2fba535bbb2020e5899d98773c140c27abbfef4b4754ff01ea10e38604ec621f48a4af14715ee81b0ba10bdbebb5104bbc2411004a2962b0e7f5c2ebb27590678510c06cf880f9f529b164e75be0b7481881089944744bc33a0b8fd35d7f7a4f1dcc1bea500919e42aabb7f84d821fb1f018a4b
COUNT = 2
pre_master_secret = 53190431150c5c4415cfef6a7025e7df33d4dcf0fa6c95b3b4c690eefe667ed28babe6d0da463f5259fb9c66db0f2b4e
serverHello_random = 03f3d8cc3e0b76369d4e6150ed54acbc7f2858abf663ba5cd65a4a790e0fc47a
clientHello_random = 26758640c585d3590e2294147cdfab2769f0e79bd46e2183d544eeb9cfa3bfa4
server_random = 365453c3dea5d2db96a4013dc74aa512c62c9d00f47e37025a3fda9c975050b6
client_random = 890dbe80be36186bee57eb71c3f93715c4f5fdf36bb54c1454f114ca4fbab739
master_secret = b7afa42cc017bb244746206750f1ade1fa7040e3503eff6eb1c31c040533238aa802cebccf3b21bb030cd8beb9d11720
key_block = f5d7e815131466cbb4d111507763d0e624be5637c209df31b2d894d36188c4a2bfe4f7d9c5c98b8884d3714793b980321a9eb27397f0e00d6612a03e37c61f966696597db68397a2e9cc75f2dbdb4da37a41e6664748907b72e161edef71f3f320f2af1db5f4c93a719a56a55681d27fede32bca83e4cdbfd3ec9ef3caf88fd8
COUNT = 3
pre_master_secret = 5fd2bd73b89a9e0f1360c8c411571271fdf52eb136650a2fdd4adbd56470aab50effcaffbfa763c0811481d3cb474bcd
serverHello_random = b74b1a3b54ad68d3d0feb12fa4d14f5cb7ffe886814e977f4d213a88d99b7419
clientHello_random = a36f1586a2cd1245345555f66a856b25d05dd7e4629416a795eb78d5c29d0779
server_random = 163ef353e186f0d3537614ddd1a95563ac701d24cfbd2588e47e36b6a01d9ebd
client_random = 2a55b61c85cbf66e0e5a6dc54b7b4e695552550121abb1e8ad9b65e335441c94
master_secret = 222c037d460c0029884735dba6a4ae01d356c66f3234333ee5d39070f0553d16d1371dd6560e0268a1c96aa3351d65b4
key_block = 690bef3fc09d99725557eb72d6b1b4386e52b57e2868ce63d6fd0b14edfc7195bbb07e477a1630fc1e5ee7c4a426106a442fbd7d4710d849e5bb4c681a09d4f321af14311bba7bde2e3571f325c07f7e4755df4d8da4df937a9a9e4653fc331076de8a2b4c532d3d46cb959205d68e010c1d4d22c94889940c2827d60481903e
COUNT = 4
pre_master_secret = a1bd3bef6a665a38239651fabb9298af8e678b43f0d2c03d798ad83a5c5918ed9a324391b0adcd41d3dd8ea4664146be
serverHello_random = 46514b346fa6633353426a5b84d2d69a8fa24e84f24932377a83ee47a9fe3280
clientHello_random = e8198e79552d43c020676c816ac03132d5306cb718eed80f4a22d18b5b053b07
server_random = 2a7eec98be7ffd77e6dfc17f16cfe3c66e59952ff5aa03c33a25ac5adf7f8337
client_random = 91d1a103770a68cd4318a38ff7f53ec76019dad95e29dfc3b30cce83cc1611d0
master_secret = 2c83548b60308b13d91b701992c36ac91f4b4aa9a23daa26cd5df1faeda39a43cc8bcc4a1faeecdc29490c2ea4534246
key_block = 9a2d8422e831490312f2c635c91ac647e31a14723ae6b53821c8b41497501a7d3a71f3b44d33b7bb7522116e1e3dc75c72a8ab1be8d349101e2e499fe9ec2037530756e80b14d2635968dfa08160ddcb95dfd56aacd1e70f5c7090d6423ab1e345b01a221680d3f061bc42cc1b06c73ad1776578b5a0719d5fee6b7492facad3
COUNT = 5
pre_master_secret = 7542dbaa360b6a5ff065c49b7df16c066c7dda5f772e9f585d974c44c7202b7cc86e63f98ab216f2e2f859e568cdb537
serverHello_random = a9cfced959dd5987e1c486531382557dc86bd92846afa953423290cce9183c1a
clientHello_random = bf85279500b15e2523a72a304555e76df0ecf32fb2a51436e269bc7e2b98d8a4
server_random = 79a061996f425e855f252469bcd491603da54db46d00375ba4bc09c242385d41
client_random = 7b4a83403c146f8e882ac5854f5d3a47f009e06bef2d1b989fb90bdefd680bea
master_secret = 1e955c7a95d51de842c4ff2b781c61ed82591184d99ffe34445724c108f6f5fb4858567ae4df269cb72cde7e8a50eacb
key_block = 1bbbb599960f4bcdc3117ec8b1903ab6d67767e689e30fd4ed2a75a3bf91cfe084acf62130694299c2610b3781db924de3a94e218d088f75b5be7ee5e94bafed095b3932870c645b22cfaef05b1ca0ad5926e90e00e8a60de0f63362220f6a4f8e3877cce1df266a0aaa509c7d44ac1adba8343a2c505939df0f8ea29e240514
COUNT = 6
pre_master_secret = a607605f90a7edbd969f3238ad02ed28c784e49ccf7048aee3c8669675bedb6bff99e704ef42c0c3ddec32f2ff2fbef7
serverHello_random = a449f0291f22f0029ebe396a275cf651552c9391a316b0ee6a12f51b19ca9470
clientHello_random = 27b3040ff8e4ded8cb7b1ca21d51a7d29027810ad5ea60af979d8169a5243676
server_random = 8ff18d029feced5e26bb8c03c78a8d9a353ba5b0da13d7b161c7a4562312cb85
client_random = 13b2ab4b0f01e0de9ab945507427cfb349ae189af9b72b06ec835b0abf959980
master_secret = 07da3584b6c0fa30c10a0ccc8d37df7dab93d02525d2e2579e13375e841755323cdc82be3b795d19f62f84d9ab6870aa
key_block = eecfeab44920a337b6f3711626ce799efd875e0ebdb6e20e4d0776730df0adaccf35d2fca4015fed549113eee7905fe06aaa845809cb1f0102427db95cb59c466fc3940290868248a321faed282564be1e16d232ea2b1e63400727d71599ba4fa4eb588776c1500aa6ffc21837e9048cda14fada2c512e520d48dcb756a4769d
COUNT = 7
pre_master_secret = cfc29604bf3a83ba2c1d67a99e42aafee4a0e6b34dc422b464836216424c3c8c9f7f32936c196466e1e8c0a3ea5d6ce3
serverHello_random = 3dd25732e752dd768d326d1b87d02674b123a7a87b404647d9002a9aa8584da9
clientHello_random = f25141f8c03541d8940c4a0817cbc81dc0d28a38e5a25d45ea9abc545ef947d9
server_random = 9a9dac4bef0868de4765d6ecf4a10be15e20ed5142f098c2a2db1f72852e245b
client_random = fa6299bf8c16803821a306b64c57ba96596741e17c8a585428abe9d2c96df218
master_secret = 833732f5bbc08bbf30aa2fdd718f61779a37588f5c38c473be7d8dd051f8ca19d4c6c59b8e8ae1e410203a7379158b5e
key_block = 6ad08f854b76332111708b13fb404fb277319dfd1d5b0bc91a5d96cde8742c6a197d06c2118285532d5b78c0a9c9ad49e6cd77031719a56a5d4a737b7895c308956054d6ec6ae9c1690ea76f7b152f5e8cde2e37c8bd35bbd99a20f2efaf32d72e8f96fbbf3171915f8852d850168c8d9da6f19efdf4db4b925b4458b43c0ba3
COUNT = 8
pre_master_secret = 8fc210c4e5f4f01b6e3bb798ad4f0f6ce17c5c72d2ce6772dc32a53612914abcc4bf44f72d8e60c3e69ba5a79dd78aba
serverHello_random = 2178817eaacdddc8e8118314b2e9e796615d484c5422d44b1b03ffffc7ac95ff
clientHello_random = 8622da6c4e381831e1212cded17f276d3d99e144df210497a770ac9354f7637c
server_random = e731411bf8c46ae8046cfb9d6e72503d25c29862b114a77f425b7a614a5caf50
client_random = 4fe5f6ba8907b83ba112b5b7d74ecb8c158f1ce399695fa7958fa3886f0de6e5
master_secret = bf8555fec19d011d6cb9a303ea08cc3eb25a01141bde6d48e48e9330478150fb17b9ce15bbffe5e5c8b1405fee9929ce
key_block = 6f2d727dee47d204a0150b677b8d727aec67f4c502bf0594e3720cabc67ed9114f8e33b44003ab2fa13a7c62b58c60688dfe4292bb076ed7fabacb925b6cae2f797b76884b043cb8e6512ea1cb209104e20a2874d1dd6da76fa53f0fc1f1b1f5207db278815eaee9263bc9adbca9612161e62c69060d0bcefde13d01657e055d
COUNT = 9
pre_master_secret = 0c2a831bf5ad7241cd0078b4a2f5f7f394c211bbd164f4173408950ff771dca25bd3f880659a40f52780766177cdd527
serverHello_random = 8209fee2e397f5d434f63234bbcee5aa286dbccad60c8c3df3eb56bf57d5479d
clientHello_random = 24e8fc68268c290c576964fc66a84f67cc09e1ec0b8ca33b9afffcc8d6697e00
server_random = 66acd138ec6173800bef5f21b0208e77228f43a63654b39a9df3d68b6dca4e01
client_random = fe9683162fc11a164e0c14a04318300a8dba2bc688faae9c170eea931dcc653d
master_secret = 173e2c37da2b463df5b591860d2442b6c0c5d07bac56147631576e51ba242a5a59e6dabba431ac22e9cfc2dd41aab7af
key_block = 222f8b7c10c0f486a344f5ec7e0acc0612accfb2e9f2d944cdc5e37b76fd687c7996e942e15ac072a643750ef8a642e84bc35b7414045d9e814cd9e4ee7379d502410289cbab11a68a706acb4ceb959c1d07f3cae1702a872a5a2ac5b54f3ea022e5c7841c3e6f8c5af2007fe3f903ba5f2849a52405182edc5e610149e30a28
#[TLS 1.2, SHA-512]
#[pre-master secret length = 384]
#[key block length = 1024]
[TlsPrf1_2HmacSha512]
COUNT = 0
pre_master_secret = dfef39af25c12663a91ee5d27042b9644a16ef55b81055d1bd7dcb0b8f06eb001708cdefcf82591defca1a6f1ac693ab
serverHello_random = e2339a6c681eb30808883971b1ce5b9b1ece0f3d011a96a7fff1f5f9d80ffd4b
clientHello_random = 78bc5298dfe9cf8ed336c2e2f0f6b46e2456f39f35f1143cd21eaa16277025b2
server_random = 11cfbd3b45e5e917c4edbabc27b9feac833bbbacabd079465b2759fab3063330
client_random = b5c41ac5ebd55d136d916547fee741bc1b509f766d50b29d7378b0cebace3c8a
master_secret = a70c5fe8d34b645a20ce98969bd30858e729c77c8a5f05d3e289219d6b5752b75b75e1ca00d3329658d7f188ed1ab7e0
key_block = a56650076e6bdaad7e1ea42d68a0f5ffead9b6b5232ba538767e4cc6a3ae9abcae897b068645496cd620f865ce0879081a98901fb98b112ce1f00165e7d6b3288eb4d4ed9811fdbbc24e290b8e448c71da72498449ea67cfdafd66adc31a89d83cc44cf01c749fb531494ff8cb9a677762a7220e32b7f251fde09841bf97110e
COUNT = 1
pre_master_secret = c0e2f0d9897fff0cfe6adb9916f5bf9aa2977977decff80c14f284e1d0391d0cdc320681177aeaca9f99ac398738632e
serverHello_random = 02bfb194b3443d2fdf4466c88a0a05c459995d360476ff76df9a088832c8ac59
clientHello_random = c1ae884cad43fed3e2e98beb225ffbcd93c5b3ffb634f2b658a0c39b97eed8fb
server_random = 8e111a579904a5c79e6db0832ccb8190ee88db5fd722d8b3f96379286a19f94a
client_random = 00ac1cf7a2a6376548eba6b6f69ba9e10ab93cedca87521df83e84269628e45f
master_secret = 74348710df03212b648663bd0a2b9940190e59bdb592876c747656b26f36ce0843505b999138459cf921503ab1c2bffb
key_block = edeed5638bda76490ff7a3d39f8bb8bc25c9811dd8b2bcd67ddd9c588bd7f05fb8c3328bc6a3252d5a4fc6b07444f5bbb39f67a6e193adc45e282e2e40d5ffe77342101f7e414b28babb94e727cbafa0bf2fc1895ca1c3045a6b75e4d0612345988b54821072432a5b835699bba58bf7cbeb1496461fd99bd76bc82e738794b2
COUNT = 2
pre_master_secret = c5a102a2d0afd0cb96b6813791b375bb3dcb202d871c1d562f858b10826962eac957a4f057fadc3d7e17dd62ed3983c7
serverHello_random = fcba9a3196ad3909346a1397a7082947e336ec7169c38691fbc3581754ea15b6
clientHello_random = 2c65807ca3fcb99daacfca167df9261ad468be103790c954cbfe7199f57c3aa4
server_random = cecf1f55a8b83e0ae5ff1e7fd149430b390d02dce4da627b39cfde2eb2fa3d36
client_random = 3829a1f269ceeac08b7c523181efbd3a9e57df46c82ec260c3effed1b81e6bd3
master_secret = bd7c63def271bbca9c95742b033629395d71cb64f5373206f6f9c5a1560344521292e87427329558b158619614c8a9dc
key_block = 1fdba5e5a5e3a576cb77bfe5f0f64aa6c995ad44d522c75752d858d94ae68017d87f43a354befc709129fe0ce8c2eafcd0b2ea33bc3126db2879f9fd6a3718b008c64a3ee00fe1398d6ed1d5f03cd44e27925575e4dcf487986b0fe06faf59d7d8658b168838f080e06212dd513bd4fc2d518e2f54edec539c170202413051a3
COUNT = 3
pre_master_secret = cdfeee35756cfd4727ce3f8a327c43db426ee701894cd382bf25c692a60dd3464e4290fe62173d1ac33090cbef0633d2
serverHello_random = 4d5fa613fc95a52d8b5ee699621d83a94aa159ec4dd9c093e4dc5d71c8480946
clientHello_random = 6fd4a8d2d69bafed6c9bd96df2a25c6683a83f1bd0a68cf52592602f6d971ded
server_random = bd41d7b7feb4585ae1e306386c6aa50551baa03e1fd6b1cc6ccad4672aed2f4f
client_random = 9abf757b95fd34c753bf032088575f9c2b5649311cea0b0e76a56829aebe5f60
master_secret = 46954f1576c8d03a179784ba8586a4f817d0b7a5f108f7b7acc84887b63a937e207213246888a5b78080993ef0e34f5a
key_block = 352cffbb12813c829c11728077e5d52f6c0345684a8e9ce084d542a15ec88497e05316a75590ec247ff2a2a0eaff3ca2610c70e914d876aa29261e84490e0466e8d3069e005cd7086686ca06021b04b4b50247d31b6e25f43f1df845c7f1b492656874745ecfb9fdc59ad873b2c6bdbc54dacc0b98a2e605c78f5b7841b67650
COUNT = 4
pre_master_secret = 37419bfc67c12a0e8666b350ac39d2cbc96ef9990b6929710d67016b36b7383ff2326da0530a1cda0355315a864e377d
serverHello_random = 09661024d6ce0ee36a935ad158d1e7923c6e7e96f713f5ef68a6634b9ef5fad0
clientHello_random = ca822c92279a12a8c5df9e1188bc699bcc9d07b27a4d3f65b2dac278f7ec9291
server_random = 82278d4f51b8e9052c0d569f882b9d63d2759b7cd4a7e3209ae3982edf281c53
client_random = 1e5109952e3d5550dd191593d95e6929a48aa2b6af160adfcb9f9d9b64bb39af
master_secret = 06a678934ae216213450d11b2abed3170079a9463e072ba18e2dbbe335d8f921bc6ec6a9abf91c157d9367f5f3aa8e0b
key_block = 43bf08a7de83133bd55171c6d5c7f26bd6717bc0c82c8a61d7efa4350349442f3cb4a1f1653c746cf448849e78857b270edda7625870cc3e107ddfb654de7b1239b4dba7cfcd273b5163526891efc08b914856fbc9625e421799b2b9e09029aa1e522420e635c02e514fa22cbf8695fb2329e125ac25fa2fa07b326543d524ff
COUNT = 5
pre_master_secret = a3c08766f44454d656d10e9a03c3bb6c080e71a4108258824ef5ba8b19052df6ec7b15cfbb08bae5c818243bc6dde658
serverHello_random = 254941766feb1c317b605c255a131bed2c950cc359509c176604414fafd51ae5
clientHello_random = f0e6c1e2872b9d9159e9df397c6cefd68b2ee8e984cd80a64bbaa203c24c3816
server_random = c295d3357fe3eac00b365246ffec78290849179bf6c9ce9c0cb679e3f24bb35e
client_random = df33519c18123b3afad93b896aad8f0342949c17165ee5a706bd96f39c52436a
master_secret = f8234578f0dbe8c2b23b7d6b7a5a51820b5c7af6b8cdf710cfc557ddd4b734d7210b83c002983d859131d101bc2beaf8
key_block = d9a60d90db7d0b1800c36a0f5c7f2e95b1ce998694fe254d94bfbf608c9d195c370de780169fd35dbb7529697d07eec1a50aa2f543ef0ec4f201f4ea9250d8a40441d1dbbf9536280afcad0f9f2b9e4529e7344b333e803e82b323d816f744553ea7e05b18289313860a3b34923b9fc29cba4cf6fbb0e7449152147e9028145e
COUNT = 6
pre_master_secret = 564d4bd6f356bf0a19dd65de9745292a58898e1fcd1c5ad8f5591298a6f66d070cf34ba16da9a2445e3308a7a9382f8d
serverHello_random = 9bdf519e3786375be3343caa1021f6635735c2cd4cafdac9b8261dbd9a02821b
clientHello_random = 78ec68e5da54d6013c122c5e04755fbefef79ff4da95d07e199033e9f2e426bb
server_random = 6fce309e320a8d08041b671a5fe811499bbb7032e11a88951468ba264d82a0b7
client_random = 133467249dbd07be95a0338765e1bd60cf340c892b7e7d6f72b571d50279119b
master_secret = 06d46e2b599e49f2acf873dc96676b811f22e369d1922ddd2b16aba2bf656b80307f116fc436e00a4ac26e1ac21a6d6b
key_block = 5d0c9ac0f0591e7dc02f9a804b8cdec9f1f682d457f6f27ff646242da9cc6caf82180ccbf68754c03c30cdf7247242da911fc7a6fbc94fd0bad0ad15097b293bd7194d3fb09621d2bae86a4f05d2069db03c75e02a4a9588be69ff93a9d2ec7dd11cd6fab23aaf666faa1eac6a219705aecae99d8404ca6a99cdcc415ba21bf3
COUNT = 7
pre_master_secret = a4f4d0be3c71326063a9e6125a3b2bcccda6c780eecfc7b86ac85f4646d142539cdb9859f474282acf1effd49634866c
serverHello_random = b7ede5dd2ec41fea5d8d3d8ec4618e18998316640c867061d5c8f0366d2e0cc4
clientHello_random = 8b45b0a086c3743c1f19e9ff5f7dfbd109d86dd493e3fc21247764328726f5e4
server_random = df78f11f03a2a23fd9c0c7f7d12e02194b5f7841169d451a6ac692314db988e6
client_random = 823544dc272fd8c4d1caf6c859f0a53a136fb26120ffb89f2d5261da0ec3c0aa
master_secret = 59eb127528a078aab1e43d3ef801d9015e52ab16ddece4063502e8f5b1a1d585f5d0e5d66842b9fede28bb9cea93a033
key_block = fef6656a2da392b4ad86d5d75938f73841962c5281916d60a826c9c9899222d4c0a6098fbbbb7c4572821dbd4726cd02da6e00e093ca05a21911d844f17d9246dcf2974cb07eb0ff4cbe84faf1f3995a3f7f9bcfcf578d6326582da70383f6db26c17b4d8af58a6b7621e6b43371cfb58da1259bb1f5549d2b978f5dcf482c73
COUNT = 8
pre_master_secret = 8e5ba5772a76b1c2dff94d9130b6264788d5c84d54712da0a8fc23b405be10e9870e499afda935f53da86b771fbd39ff
serverHello_random = cfe745d1602b3fd9bb8fca34c6a3a7819aecf9e6017bf6a9098b720e6b9da27c
clientHello_random = 11b080c7f741d4190a8e2dd9ad241f47245009ea350e52293b78699b86d18f4f
server_random = d515f88ab7c9908410507a5eb54ebadf2f59aae5787818a6818e8371b89d5360
client_random = db976ce545619a8197beefe3d9b3c694ff514a49db301439ba82171dd291a495
master_secret = 96af818b239e309212200d77ead5aa751f79bb2365bd8a57abad6d9adc96eb9454194425c7fb991aae7d2128efd64f51
key_block = b25185c8e308afa0bfac3af0b7d582a177aae5452da5828068774c2cb136331aa343c706f3ca4bb98ff955b8bd24e3325e51a0c868f19b8c3e7ba703f405d8c0ea3efd4aa7b6c6eb913795d4c6faaf9b1dee504a345eb0d74e9d7c3fbb1e837b5f26be76cd97127bc3a57b954eb01e8e57ba3f53269c76eaf30f310d5f2af49c
COUNT = 9
pre_master_secret = 320e2df3344029c79a9bfd72afde9e3e32c862a6fd7da1696c54de655f15e8ce8027519ad11e69dafa6a7887b6f4e237
serverHello_random = 3a5ce6efd31e1c3115e816a7ed78d0e93a2fdfb2c5524b4de3e705bcaab38e3c
clientHello_random = e00c3729cc85c6a53c57dd9b5faba81cb6601d019a4b2728e0cd91f41ea843f1
server_random = 42b1b50bac6b7587a88bbd58853c87b0e4922e1cd48d677cb559f4a7c0fa36f7
client_random = 83596595d4e8b6a67af1d5a0ea2122cbe8e1aa30cfa6e5af964c10fa8d54c196
master_secret = faebd9a5887b452a681c904b08c25de58e879609775e9482ef744697d7595d3ad77bf5cd9909dc9d4dee5f5d3725fcef
key_block = 4db5eb0e49c5600a76b518546c24bf91620244b4e26e7f7f530b58783478e485e4479f208f16dbd9af2f13400878003a6aa0c5a21b14a7f54c42dad88a4aaa80e60c81915302a77791f1631a95e0e92f90dce780dc5c4f5df81fe0d6861abdc2d36249c2cd76391350026ea80430fdef497ccfc45e41804364c291195d61646d
#
# HKDF test vectors from RFC 5869
#
# IKM: Input key material used as the HMAC message for the HKDF-Extract
# salt: Salt value used as the HMAC key for the HKDF-Extract
# info: Info values use as part of the HMAC message in the HKDF-Expand
# L: Output size in bytes (size of OKM)
# PRK: Pseudorandom key which is the output of HKDF-Extract
# OKM: Output key material; output of HKDF-Expand
#
# Note: L and PRK are not used in SymCrypt functional tests since L
# can be calculated from the OKM string and PRK is an intermediate
# result inside the HKDF expanded key.
#
[HkdfHmacSha256]
# A.1. Test Case 1
# Basic test case with SHA-256
IKM = 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
salt = 000102030405060708090a0b0c
info = f0f1f2f3f4f5f6f7f8f9
L = 42
PRK = 077709362c2e32df0ddc3f0dc47bba6390b6c73bb50f9c3122ec844ad7c2b3e5
OKM = 3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865
# A.2. Test Case 2
# Test with SHA-256 and longer inputs/outputs
IKM = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
salt = 606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
info = b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
L = 82
PRK = 06a6b88c5853361a06104c9ceb35b45cef760014904671014a193f40c15fc244
OKM = b11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87
# A.3. Test Case 3
# Test with SHA-256 and zero-length salt/info
IKM = 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
salt =
info =
L = 42
PRK = 19ef24a32c717b167f33a91d6f648bdf96596776afdb6377ac434c1c293ccb04
OKM = 8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8
[HkdfHmacSha1]
# A.4. Test Case 4
# Basic test case with SHA-1
IKM = 0b0b0b0b0b0b0b0b0b0b0b
salt = 000102030405060708090a0b0c
info = f0f1f2f3f4f5f6f7f8f9
L = 42
PRK = 9b6c18c432a7bf8f0e71c8eb88f4b30baa2ba243
OKM = 085a01ea1b10f36933068b56efa5ad81a4f14b822f5b091568a9cdd4f155fda2c22e422478d305f3f896
# A.5. Test Case 5
# Test with SHA-1 and longer inputs/outputs
IKM = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
salt = 606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
info = b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
L = 82
PRK = 8adae09a2a307059478d309b26c4115a224cfaf6
OKM = 0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4
# A.6. Test Case 6
# Test with SHA-1 and zero-length salt/info
IKM = 0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
salt =
info =
L = 42
PRK = da8c8a73c7fa77288ec6f5e7c297786aa0d32d01
OKM = 0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e07b6b87e8df21d0ea00033de03984d34918
# A.7. Test Case 7
# Test with SHA-1, salt not provided (defaults to HashLen zero octets), zero-length info
IKM = 0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
salt =
info =
L = 42
PRK = 2adccada18779e7c2077ad2eb19d3f3e731385dd
OKM = 2c91117204d745f3500d636a62f64f0ab3bae548aa53d423b0d1f27ebba6f5e5673a081d70cce7acfc48

2412
unittest/kat_mac.dat Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

475
unittest/kat_rng.dat Normal file
Просмотреть файл

@ -0,0 +1,475 @@
#
# Known answer test vectors for RNG algorithms
#
# This file format is based on the FAX files that Atlan gave us with test vectors for FIPS algorithms.
# Many of the test vectors also come from them.
#
# Binary data fields can be one of the following formats
# - string of hex characters
# - Double-quoted string for ASCII strings (no terminating zero is added to the data)
# - 'repeat(<int)' followed by a data field
#
[AesCtrDrbg]
# Mark these test vectors that they require a generate call of 16 bytes after the instantiate
# and before the reseed
# The FIPS 140-2 version has this already internally to fill the perviousblock buffer
generateAfterInstantiate = 16
EntropyInput = ec0197a55b0c9962d549b161e96e732a0ee3e177004fe95f5d6120bf82e2c0ea
Nonce = 9b131c601efd6a7cc2a21cd0534de8d8
EntropyInputReseed = 61810b74d2ed76365ae70ee6772bba4938ee38d819ec1a741fb3ff4c352f140c
ReturnedBits = 7ea89ce613e11b5de7f979e14eb0da4d
EntropyInput = 50e6f03e0479ac1bffb22af393db4d0979c67379ce7a95804d1ea109cc24167b
Nonce = 533315bd3d0132539620451f21dfb0bc
EntropyInputReseed = f1bca53cd57caf52dac4065efafc8154b3b4959d08507263b9f55b20c5b54468
ReturnedBits = ca9f2ed0bbe4c90abe2401cc12d4e0a4
EntropyInput = 009bd2f3a7916aa5fde803d9a54ededf2cd0c7839ea4d07b6237510d5d781f04
Nonce = 7e56c89fd36f185fed96bbe7cf5c50bc
EntropyInputReseed = 07b925d9de572bd92baa8e6ad522cff1decce303e686d22be2608f001c541866
ReturnedBits = dd4a14ee5eb09a160875f1ae759632dd
EntropyInput = bb6cef9412ad08e798d22f50b81bf32fcd7ca9a49dc00856150102854446e351
Nonce = 11fb50aa5192ddfbafb6983b4c94eb00
EntropyInputReseed = 27b61c9f37e1a11e5b0ad010754847795313846c6aa9c10fd3bb14eb855ec578
ReturnedBits = 5af0414099b0e462f3d47f45291b798d
EntropyInput = 8ea8218814741103120bc2aef703a79ee262b8641bc911ded6e2c73d250e0d59
Nonce = 3150c311750f6dd848d7ca44b609b148
EntropyInputReseed = 0914d600f4b22f3af54e15debc3e3b697005f1284820dc9e6614f631fab7c81b
ReturnedBits = 07152064a6d33e80fa107b51af1afca7
EntropyInput = a7a547c183042101e327315eb9f9a3821c026ed5e33413e983f894212c7ab1a2
Nonce = 40148206c70fe18898527969239c316d
EntropyInputReseed = 59adddfc4e6be6f667c64af8a92138d6f3974cedf6a7ab6c742261deb753f8fb
ReturnedBits = 11973fdcedc01fcd93de7c06f96f3bee
EntropyInput = da63ee12494d77ce98fb2c74b95ae2cdb84a74f4dceefc4800374e9031b2b76e
Nonce = 4d5b3f0bba14947e24807248d2992a8b
EntropyInputReseed = 778b5ba5572f22b132797d82b293ab3d45bfe8085b3ec39ada7dbd02e48024b5
ReturnedBits = 4fdabc320e05b16a5370fa64305557ed
EntropyInput = 0df1f706a1ac9c0b680361b0c13d7fc7353b506e36e82b1717e280d74e6936f3
Nonce = ffdaaf6031f71e0ce49faf75dc75fe22
EntropyInputReseed = 27fd02691e639c9b578605d78d37f37375a0a9e7b7ef112029401c094dce5d55
ReturnedBits = ebf830eb209fd9bff1e040eb4de02409
EntropyInput = a5cb2abe2f0eaf0209194f1dc1224a351da3c7214d4432fa710ddade4dccc906
Nonce = 06ddacb7304479aa3756f36c68353659
EntropyInputReseed = e5ee69ed2ca0aa1873653411b7a335589d8997846eb9208e5036c95ec98f5d95
ReturnedBits = 3e68d2449ed63d8f6680fd312d9c1df2
EntropyInput = 8272c3c98c1abd42fc6577d30ed098aa02d57210bbb9bfda9798990c8fadbecd
Nonce = afa0349cc15895b2f6647f0ded758ae0
EntropyInputReseed = 5bf4e60b7d12399085a160b59a4f70010912bf9342d4f76e15617aff2d90fcf2
ReturnedBits = 26c8d9a624a7da1741dc6975f7644fd2
EntropyInput = 7106ed1932adb60804c64ed1f409c756311f8e564d94c401b1feddc1606d7846
Nonce = 2961cd01b18d7ef168f1ca73e56b0ea3
EntropyInputReseed = 84fab21e8452e3987bb5d357be1784975c2d07e0a39921d8d8542647315a116a
ReturnedBits = 2fbfb8c66101d1027b714092bdfb701a
EntropyInput = 146b02326e26ad4e40ab6e7f0439813f5efd2709a141402286d72da52ac6e6cf
Nonce = b0842724d60c88071137977f9ba91887
EntropyInputReseed = f832fd383c26bd7949486570c49bc492d4a1d3f2c42874aadc536a887ae59afb
ReturnedBits = 2cf64a1fbe6af1753c916814a538f5c5
EntropyInput = 252a08d9be81275e9332e86d17d2bd71f6e0ccecd438c88948b50b641a26f697
Nonce = b440bb0641cc80deb16208329bb63ec5
EntropyInputReseed = 3505378f1fa93859e623ad2feee297ccf33856ca66e524d10ae1d400d16dcc99
ReturnedBits = 4153e2eb561d0b6e8e16fa243e2b7129
EntropyInput = e76993153493bd26c8b6aa995924bb5e3fa7d23a87ca8fb05465d1337d6d6a8c
Nonce = 4e98e5641eb20a9646a75c0597961e29
EntropyInputReseed = 4087ffb77f3d3fc7bc611a0e18f832e6f0f4ddc3989dfd3e58411d64a51fcf40
ReturnedBits = a92270952d886a8528485bfa238d01d8
EntropyInput = a54f652802a4fe9585c85f839c258855cb76b85e468d2247d164eebdd769715d
Nonce = 67733798d9b34e42b3eb5f466f836c5e
EntropyInputReseed = 2b8f3c23ffe33bdb9ad24b3d89925437f67c33652a3158db410d9f372ed06ee6
ReturnedBits = 31ac5c819f870b35755c4ad654b1933d
EntropyInput = 55961b67678bfccbe85c0634616a93957b63e3e8df4a1bda4cc27ebdf9a1eca9
Nonce = ae4f5d602c250e04dd96fda6dd27793c
EntropyInputReseed = e2e90dd9c7e9ec5a8be0d57fa634cc596408eaedbe425ce974df9f876e75fcbf
ReturnedBits = 60f97799ab2c4d0d8cebc9f82ef3b094
EntropyInput = 3a1b9a1212a3927376873d8b4cb6c65ce34f4898503249cd09c675d0c20a9d6e
Nonce = 72466dbd615e0289fba21236f08e6e66
EntropyInputReseed = e86bfc1dab58ec9455ee8a85f2bace5702c92cf2de3b16ed4e06b4f46a08e27a
ReturnedBits = 8191b13382b9b811aaf114e320cf39e3
EntropyInput = 98913a5a022d31487a49b474460add3c4461806a7ed8ea9d10a3dafc3de5be1c
Nonce = a5b5c4d6271cdc5f1748b94e7577c1e6
EntropyInputReseed = 2972585438bfaa2ad2562dbb94bd0435406eadaaf5c55799ad2988bcfb78ee13
ReturnedBits = b1e9acfb4a9f1fa839d8ee8b9250b2a8
EntropyInput = 31a248cfdd7f7e6ff474430203e19d97563c33af11608d2f8e148e85f8d93118
Nonce = 2faad5f380e82a02d716339b4d93cb59
EntropyInputReseed = c7b8452417c1da47afc388af4fb777b4d48fd104557fff8a7e8727a12a43e578
ReturnedBits = b18f1055a7f1e9050349cfffe309c4da
EntropyInput = 0e10d57ef22237a5372128fd6944921d246726af56f6bafdb518e7b8821fe209
Nonce = 2b77a9ac2d671ecae9514ae1cdcb4977
EntropyInputReseed = 517856ea4de0ee0142335b8b7ebc2b3f92b0460b55d70f5d1e7abeb33c8efb64
ReturnedBits = 427b04233dc0478a29eee6e1a3ec2ad9
EntropyInput = c81675926f304a17db0a89cda9d8c515dda6f6d7a5cb4e9150925aa590255be2
Nonce = 11585a8be52579586e017be2d2c5917e
EntropyInputReseed = accb7fa2389951a3c43528c2ade5e7ef72e3cbfbf54bc625ef431ae6b36b3800
ReturnedBits = 3cd35a5807ad8bbb16842cf42af95adc
EntropyInput = e3fe7a35c2348cc7029d7138cf8f5cb2ebd9afa4ab7011123357d31bf4cf83ca
Nonce = f2e932a082e175df669035443f7ceb38
EntropyInputReseed = 5fb80aaf966b8541ad44955045f3269dc2e58bc5ea1444afc10ff036a2468e15
ReturnedBits = e2ce4b93f68268c34eb97ed3a2dc9687
EntropyInput = 0b3174f0498269922d7ca210cbfdfbdca4163d18fc949ec179d27d1ffebd586c
Nonce = 330c613d0dc1577d6bae1a852c412963
EntropyInputReseed = 94518fe1e65b9580e67b40209a9514fa94b2884d104f43464ee7972f31bd3dda
ReturnedBits = 4ff475b1cdfcd3d4c0aeb72533b901d8
EntropyInput = 85162771c7dccd3a7c7f7f558817d7c9b81c56a681cc3513fcd88a9921559eb0
Nonce = fad51370421fd31a0af27efbcc8afd56
EntropyInputReseed = 1f99d43d79d67ea2e4b52b80fc13e366b90398e7647c4aead5455b34f1232e31
ReturnedBits = 1c8471c2bc49c87514a2a125bf2f316a
EntropyInput = fa65623db4072fb8d33340847b18ab00316cacd2bb81a595328654c36b1b55e4
Nonce = fc0c0bc5b590978aff428360f9271d12
EntropyInputReseed = 5b6fa2c787cc757e43c144d2ede9802c3272c19588425f80ef6a4ed5eacf3d3f
ReturnedBits = e90d3b9d7475817218566fc9b74d8254
EntropyInput = 438441771cc64bf052c70589b3517a2470106d1194baf1d8c17f454a2bb3f3c9
Nonce = 5884696a843b00eafa2dbd83ea03b713
EntropyInputReseed = b7a5f4ee72000d767ffd3f326780e43c9c71530a716ffcae5bb9c66e695ba786
ReturnedBits = 4084071bcc2f035420f7466c96fa39d9
EntropyInput = 31dbfb5565fdbb7489f798302556b1b8f941f6a2fa203e36888da6faf37e2b7f
Nonce = 4bc7f7bd2eeb861a13ec0fd364615c37
EntropyInputReseed = 55a0293928ecbb015341cc01f423ab8698a0773e55956229253e29c48403cd73
ReturnedBits = fc723baa510e2c28dd531a427726cda2
EntropyInput = d361c1496d0e52cee056645e22a278b2195ebcf7dcea5e582dbe32c836de8714
Nonce = f3cb5e3b4b71fb2b76c1d7de8a982154
EntropyInputReseed = f5ccd31c90759f96af85193cd6df439d50d1fefe2dba27a679fceb6abd246d7a
ReturnedBits = a5a26e335adaccb074183c73b8ab1e8d
EntropyInput = 1fb8c373228d2d802384f3a06216123bb7e224d9f032e14a6cccd81cf6fb693d
Nonce = 64ade664f6d0b723ca98be1e54c43551
EntropyInputReseed = 52dbff3d5fee228ec92623d59290f7a75a0aa68f16a4232410586c4a20ece3c6
ReturnedBits = 93d7c08530479290f22d6a6bc46035d9
EntropyInput = 3dac79901e5b1dd013ff1c7e421a1a765e57ae93c1d2a0a4cca5609482b5c8d4
Nonce = 5826c1b70bc7c9d19cce91efc0e5b042
EntropyInputReseed = 662262882911c35fa5a0ddfd1575c941545895b55b5ce05ff74cb6cbc958ac58
ReturnedBits = 5a34b55f4070ff6b9e8587057aa0baa4
EntropyInput = 0427f5bfd5c0542e79cd4e0d6cb6e6bf8816633e1e0f890257cc1a30cc558e05
Nonce = cacf2008df62260965e50e91778aedab
EntropyInputReseed = bf3700e093843c3712c9311224489bf04513edb821d4132d73df6d931e770aa0
ReturnedBits = c8020371cdd749ee0930a39559147a51
EntropyInput = c961a3d928a845b42850ce3f2773059d14a788ab4b09c8a7b185462111690e26
Nonce = 2b854ef996f1d65261041ec322c448a7
EntropyInputReseed = b6c51f63d19ef5ed72392047d53b0ddb5198ba8f14fb94cf1f7391d984618a4a
ReturnedBits = 8050627eba703320b1b25d269432dc1a
EntropyInput = 3b836e4beda3e8b6e79541e70a1bdc4d0363fb0d40acd94d2e3805c4b7730081
Nonce = 828bdde0de61e82ca3ce2db11e49ff66
EntropyInputReseed = 58331cdca0c35881ec2225ade9a6e3fcb52bc26ef45f0352314e72757830218a
ReturnedBits = 5e56d0f76b7eeef3b70aa96d48ba662b
EntropyInput = 42dca38fd6ab02dd039a3a0712a09ed9e62eb061f4d53742803ba43d1b3fa6fb
Nonce = ed3d335dcb469b10b374076766ec0e6a
EntropyInputReseed = 9c46c8278d875e60504eda7e5f0093761067c19aec3bf8c84eeee1d93eb63948
ReturnedBits = 259163a2ac1d56d5351194b50d7a54f6
EntropyInput = b5e4e64500427c4179ced164a7c1ceef997bf79be2308be4d2d6de93f84df58c
Nonce = fbcf3b088a747da6da7bbde530dff956
EntropyInputReseed = 9720cda1ed089335fbae1c164f1d3365830718c75911ba531c5c32bb345682b8
ReturnedBits = 5321fd45d6358a000b0ad02f2c681055
EntropyInput = 0753a23c003521e3d002ec7789c54e189a684b574de233fd84a48919b63f144e
Nonce = 81dc47b03c63430fbe510152758fd898
EntropyInputReseed = 6910ce06d41cd0359191ba2fc9496c65fca83c739c6ebc8fe6c1ae3201794607
ReturnedBits = c3a8803997fdf50d83db358144b5734c
EntropyInput = 3049205795590328e91f36cde0445078656044e731c51cd3ad89f6970cd83e1e
Nonce = 015ec221c3eb47ce8f106620a4f2381f
EntropyInputReseed = 8161c0bfbe411d44c59714e4e3ddf893c0bd5fd97f685fbf171a09faf2ec2557
ReturnedBits = 6e0ed5033952f2eca3d821c6f471e40c
EntropyInput = 4d99b6b82eefeaf6140fedcdb64b73bce59950e0e61bf22610f01fb0a83bf186
Nonce = 194ab49426751ded2e5f40edeadb2722
EntropyInputReseed = ea4412c888a0677e379e15919ec2eaf83a47242e5ecd87806b43be9d4a15f559
ReturnedBits = dbb8d3d1f5b98bda32d621ce3899aab5
EntropyInput = 2bdbc751c7b2cabecc9b43f73cd19ae9c300647211d2e58c79bcc5b9c90810b0
Nonce = 2454a8deba15d74d8061a40b009a137a
EntropyInputReseed = 24c96c6f1d8ee3919cd9f15c452e651a7ad22465d6f7c1f1ee255f984aebcaa5
ReturnedBits = b1e5ccedcbe287df0ab5e4e4aa5e1bf0
EntropyInput = 8fe018fa3b8601d3fb0491251fa35451578e8e262dfdd0aec49eda38d146b7a8
Nonce = 13279303a7135064a0b036b2f6bd56cd
EntropyInputReseed = ce47fbe95b766fe44a7b2ecf59a641b67c8af4e642884a18659cbfddb169434a
ReturnedBits = 91f4da875cc84a8e2280b53ddd500313
EntropyInput = 3def850f1d4d980d8739e8f06ef03132a568f065f498a41a7d05450d508f0394
Nonce = f7eff1802963ecfe0865afe7c272344c
EntropyInputReseed = 3bb701a700c2a34fb0fa0ec1a6d1ebd6ea7df7094e4a4065c8209cb311526ce3
ReturnedBits = 9280835125b9809be8018ceb73602355
EntropyInput = f97d8356d2067bf06536271cbc9b28b3de170345eb305c007a9871df31fed916
Nonce = 3f6b48b294734ec2823e50316990dce0
EntropyInputReseed = 20e26d522556a71822582d0c69b1382df59e2e68c85921c684e78adb4722466d
ReturnedBits = 6cd91222cb3644d5d9b5cee4d7555716
EntropyInput = 17ed8b61ca0ace7f6ee8e84e4ca7490e48e3e2d302f465722d86bfad2d5cd49d
Nonce = 8b9b9f9dc34802793ba0b30fd8913342
EntropyInputReseed = 3d780e508efbdf5969b60a3d1b1fe2f04be4fdfa1e3371638b494fe2fa3f5e44
ReturnedBits = 09db03998f2e29419a8cd6dc0601cf5a
EntropyInput = 039593774cc30fa6a65eec50a3462e03e4aac1ac95370f602980e36f57ae7fa5
Nonce = 0b55cb4b5597c8e9564431892eb88c38
EntropyInputReseed = 1625a66cffd013b41143d971cb8e1954edadfab3558fa63d186987dde23ac1ed
ReturnedBits = 271e09ff58c49c07d81b64e4589abf70
EntropyInput = 765f82533f7e8a0b679da29a36df91d00d0a391cc11119b739e108164a6f2f90
Nonce = 16e0a5548c00b523f9b50c94f2343f08
EntropyInputReseed = 61346ceaa7ab2ac91399400aa40df87ce8931e14b0a0dbff143cd3eca9f17c99
ReturnedBits = 71bad17646cd5cb3c8f6196c6367ef7c
[AesCtrF142]
EntropyInput = ec0197a55b0c9962d549b161e96e732a0ee3e177004fe95f5d6120bf82e2c0ea
Nonce = 9b131c601efd6a7cc2a21cd0534de8d8
EntropyInputReseed = 61810b74d2ed76365ae70ee6772bba4938ee38d819ec1a741fb3ff4c352f140c
ReturnedBits = 7ea89ce613e11b5de7f979e14eb0da4d
EntropyInput = 50e6f03e0479ac1bffb22af393db4d0979c67379ce7a95804d1ea109cc24167b
Nonce = 533315bd3d0132539620451f21dfb0bc
EntropyInputReseed = f1bca53cd57caf52dac4065efafc8154b3b4959d08507263b9f55b20c5b54468
ReturnedBits = ca9f2ed0bbe4c90abe2401cc12d4e0a4
EntropyInput = 009bd2f3a7916aa5fde803d9a54ededf2cd0c7839ea4d07b6237510d5d781f04
Nonce = 7e56c89fd36f185fed96bbe7cf5c50bc
EntropyInputReseed = 07b925d9de572bd92baa8e6ad522cff1decce303e686d22be2608f001c541866
ReturnedBits = dd4a14ee5eb09a160875f1ae759632dd
EntropyInput = bb6cef9412ad08e798d22f50b81bf32fcd7ca9a49dc00856150102854446e351
Nonce = 11fb50aa5192ddfbafb6983b4c94eb00
EntropyInputReseed = 27b61c9f37e1a11e5b0ad010754847795313846c6aa9c10fd3bb14eb855ec578
ReturnedBits = 5af0414099b0e462f3d47f45291b798d
EntropyInput = 8ea8218814741103120bc2aef703a79ee262b8641bc911ded6e2c73d250e0d59
Nonce = 3150c311750f6dd848d7ca44b609b148
EntropyInputReseed = 0914d600f4b22f3af54e15debc3e3b697005f1284820dc9e6614f631fab7c81b
ReturnedBits = 07152064a6d33e80fa107b51af1afca7
EntropyInput = a7a547c183042101e327315eb9f9a3821c026ed5e33413e983f894212c7ab1a2
Nonce = 40148206c70fe18898527969239c316d
EntropyInputReseed = 59adddfc4e6be6f667c64af8a92138d6f3974cedf6a7ab6c742261deb753f8fb
ReturnedBits = 11973fdcedc01fcd93de7c06f96f3bee
EntropyInput = da63ee12494d77ce98fb2c74b95ae2cdb84a74f4dceefc4800374e9031b2b76e
Nonce = 4d5b3f0bba14947e24807248d2992a8b
EntropyInputReseed = 778b5ba5572f22b132797d82b293ab3d45bfe8085b3ec39ada7dbd02e48024b5
ReturnedBits = 4fdabc320e05b16a5370fa64305557ed
EntropyInput = 0df1f706a1ac9c0b680361b0c13d7fc7353b506e36e82b1717e280d74e6936f3
Nonce = ffdaaf6031f71e0ce49faf75dc75fe22
EntropyInputReseed = 27fd02691e639c9b578605d78d37f37375a0a9e7b7ef112029401c094dce5d55
ReturnedBits = ebf830eb209fd9bff1e040eb4de02409
EntropyInput = a5cb2abe2f0eaf0209194f1dc1224a351da3c7214d4432fa710ddade4dccc906
Nonce = 06ddacb7304479aa3756f36c68353659
EntropyInputReseed = e5ee69ed2ca0aa1873653411b7a335589d8997846eb9208e5036c95ec98f5d95
ReturnedBits = 3e68d2449ed63d8f6680fd312d9c1df2
EntropyInput = 8272c3c98c1abd42fc6577d30ed098aa02d57210bbb9bfda9798990c8fadbecd
Nonce = afa0349cc15895b2f6647f0ded758ae0
EntropyInputReseed = 5bf4e60b7d12399085a160b59a4f70010912bf9342d4f76e15617aff2d90fcf2
ReturnedBits = 26c8d9a624a7da1741dc6975f7644fd2
EntropyInput = 7106ed1932adb60804c64ed1f409c756311f8e564d94c401b1feddc1606d7846
Nonce = 2961cd01b18d7ef168f1ca73e56b0ea3
EntropyInputReseed = 84fab21e8452e3987bb5d357be1784975c2d07e0a39921d8d8542647315a116a
ReturnedBits = 2fbfb8c66101d1027b714092bdfb701a
EntropyInput = 146b02326e26ad4e40ab6e7f0439813f5efd2709a141402286d72da52ac6e6cf
Nonce = b0842724d60c88071137977f9ba91887
EntropyInputReseed = f832fd383c26bd7949486570c49bc492d4a1d3f2c42874aadc536a887ae59afb
ReturnedBits = 2cf64a1fbe6af1753c916814a538f5c5
EntropyInput = 252a08d9be81275e9332e86d17d2bd71f6e0ccecd438c88948b50b641a26f697
Nonce = b440bb0641cc80deb16208329bb63ec5
EntropyInputReseed = 3505378f1fa93859e623ad2feee297ccf33856ca66e524d10ae1d400d16dcc99
ReturnedBits = 4153e2eb561d0b6e8e16fa243e2b7129
EntropyInput = e76993153493bd26c8b6aa995924bb5e3fa7d23a87ca8fb05465d1337d6d6a8c
Nonce = 4e98e5641eb20a9646a75c0597961e29
EntropyInputReseed = 4087ffb77f3d3fc7bc611a0e18f832e6f0f4ddc3989dfd3e58411d64a51fcf40
ReturnedBits = a92270952d886a8528485bfa238d01d8
EntropyInput = a54f652802a4fe9585c85f839c258855cb76b85e468d2247d164eebdd769715d
Nonce = 67733798d9b34e42b3eb5f466f836c5e
EntropyInputReseed = 2b8f3c23ffe33bdb9ad24b3d89925437f67c33652a3158db410d9f372ed06ee6
ReturnedBits = 31ac5c819f870b35755c4ad654b1933d
EntropyInput = 55961b67678bfccbe85c0634616a93957b63e3e8df4a1bda4cc27ebdf9a1eca9
Nonce = ae4f5d602c250e04dd96fda6dd27793c
EntropyInputReseed = e2e90dd9c7e9ec5a8be0d57fa634cc596408eaedbe425ce974df9f876e75fcbf
ReturnedBits = 60f97799ab2c4d0d8cebc9f82ef3b094
EntropyInput = 3a1b9a1212a3927376873d8b4cb6c65ce34f4898503249cd09c675d0c20a9d6e
Nonce = 72466dbd615e0289fba21236f08e6e66
EntropyInputReseed = e86bfc1dab58ec9455ee8a85f2bace5702c92cf2de3b16ed4e06b4f46a08e27a
ReturnedBits = 8191b13382b9b811aaf114e320cf39e3
EntropyInput = 98913a5a022d31487a49b474460add3c4461806a7ed8ea9d10a3dafc3de5be1c
Nonce = a5b5c4d6271cdc5f1748b94e7577c1e6
EntropyInputReseed = 2972585438bfaa2ad2562dbb94bd0435406eadaaf5c55799ad2988bcfb78ee13
ReturnedBits = b1e9acfb4a9f1fa839d8ee8b9250b2a8
EntropyInput = 31a248cfdd7f7e6ff474430203e19d97563c33af11608d2f8e148e85f8d93118
Nonce = 2faad5f380e82a02d716339b4d93cb59
EntropyInputReseed = c7b8452417c1da47afc388af4fb777b4d48fd104557fff8a7e8727a12a43e578
ReturnedBits = b18f1055a7f1e9050349cfffe309c4da
EntropyInput = 0e10d57ef22237a5372128fd6944921d246726af56f6bafdb518e7b8821fe209
Nonce = 2b77a9ac2d671ecae9514ae1cdcb4977
EntropyInputReseed = 517856ea4de0ee0142335b8b7ebc2b3f92b0460b55d70f5d1e7abeb33c8efb64
ReturnedBits = 427b04233dc0478a29eee6e1a3ec2ad9
EntropyInput = c81675926f304a17db0a89cda9d8c515dda6f6d7a5cb4e9150925aa590255be2
Nonce = 11585a8be52579586e017be2d2c5917e
EntropyInputReseed = accb7fa2389951a3c43528c2ade5e7ef72e3cbfbf54bc625ef431ae6b36b3800
ReturnedBits = 3cd35a5807ad8bbb16842cf42af95adc
EntropyInput = e3fe7a35c2348cc7029d7138cf8f5cb2ebd9afa4ab7011123357d31bf4cf83ca
Nonce = f2e932a082e175df669035443f7ceb38
EntropyInputReseed = 5fb80aaf966b8541ad44955045f3269dc2e58bc5ea1444afc10ff036a2468e15
ReturnedBits = e2ce4b93f68268c34eb97ed3a2dc9687
EntropyInput = 0b3174f0498269922d7ca210cbfdfbdca4163d18fc949ec179d27d1ffebd586c
Nonce = 330c613d0dc1577d6bae1a852c412963
EntropyInputReseed = 94518fe1e65b9580e67b40209a9514fa94b2884d104f43464ee7972f31bd3dda
ReturnedBits = 4ff475b1cdfcd3d4c0aeb72533b901d8
EntropyInput = 85162771c7dccd3a7c7f7f558817d7c9b81c56a681cc3513fcd88a9921559eb0
Nonce = fad51370421fd31a0af27efbcc8afd56
EntropyInputReseed = 1f99d43d79d67ea2e4b52b80fc13e366b90398e7647c4aead5455b34f1232e31
ReturnedBits = 1c8471c2bc49c87514a2a125bf2f316a
EntropyInput = fa65623db4072fb8d33340847b18ab00316cacd2bb81a595328654c36b1b55e4
Nonce = fc0c0bc5b590978aff428360f9271d12
EntropyInputReseed = 5b6fa2c787cc757e43c144d2ede9802c3272c19588425f80ef6a4ed5eacf3d3f
ReturnedBits = e90d3b9d7475817218566fc9b74d8254
EntropyInput = 438441771cc64bf052c70589b3517a2470106d1194baf1d8c17f454a2bb3f3c9
Nonce = 5884696a843b00eafa2dbd83ea03b713
EntropyInputReseed = b7a5f4ee72000d767ffd3f326780e43c9c71530a716ffcae5bb9c66e695ba786
ReturnedBits = 4084071bcc2f035420f7466c96fa39d9
EntropyInput = 31dbfb5565fdbb7489f798302556b1b8f941f6a2fa203e36888da6faf37e2b7f
Nonce = 4bc7f7bd2eeb861a13ec0fd364615c37
EntropyInputReseed = 55a0293928ecbb015341cc01f423ab8698a0773e55956229253e29c48403cd73
ReturnedBits = fc723baa510e2c28dd531a427726cda2
EntropyInput = d361c1496d0e52cee056645e22a278b2195ebcf7dcea5e582dbe32c836de8714
Nonce = f3cb5e3b4b71fb2b76c1d7de8a982154
EntropyInputReseed = f5ccd31c90759f96af85193cd6df439d50d1fefe2dba27a679fceb6abd246d7a
ReturnedBits = a5a26e335adaccb074183c73b8ab1e8d
EntropyInput = 1fb8c373228d2d802384f3a06216123bb7e224d9f032e14a6cccd81cf6fb693d
Nonce = 64ade664f6d0b723ca98be1e54c43551
EntropyInputReseed = 52dbff3d5fee228ec92623d59290f7a75a0aa68f16a4232410586c4a20ece3c6
ReturnedBits = 93d7c08530479290f22d6a6bc46035d9
EntropyInput = 3dac79901e5b1dd013ff1c7e421a1a765e57ae93c1d2a0a4cca5609482b5c8d4
Nonce = 5826c1b70bc7c9d19cce91efc0e5b042
EntropyInputReseed = 662262882911c35fa5a0ddfd1575c941545895b55b5ce05ff74cb6cbc958ac58
ReturnedBits = 5a34b55f4070ff6b9e8587057aa0baa4
EntropyInput = 0427f5bfd5c0542e79cd4e0d6cb6e6bf8816633e1e0f890257cc1a30cc558e05
Nonce = cacf2008df62260965e50e91778aedab
EntropyInputReseed = bf3700e093843c3712c9311224489bf04513edb821d4132d73df6d931e770aa0
ReturnedBits = c8020371cdd749ee0930a39559147a51
EntropyInput = c961a3d928a845b42850ce3f2773059d14a788ab4b09c8a7b185462111690e26
Nonce = 2b854ef996f1d65261041ec322c448a7
EntropyInputReseed = b6c51f63d19ef5ed72392047d53b0ddb5198ba8f14fb94cf1f7391d984618a4a
ReturnedBits = 8050627eba703320b1b25d269432dc1a
EntropyInput = 3b836e4beda3e8b6e79541e70a1bdc4d0363fb0d40acd94d2e3805c4b7730081
Nonce = 828bdde0de61e82ca3ce2db11e49ff66
EntropyInputReseed = 58331cdca0c35881ec2225ade9a6e3fcb52bc26ef45f0352314e72757830218a
ReturnedBits = 5e56d0f76b7eeef3b70aa96d48ba662b
EntropyInput = 42dca38fd6ab02dd039a3a0712a09ed9e62eb061f4d53742803ba43d1b3fa6fb
Nonce = ed3d335dcb469b10b374076766ec0e6a
EntropyInputReseed = 9c46c8278d875e60504eda7e5f0093761067c19aec3bf8c84eeee1d93eb63948
ReturnedBits = 259163a2ac1d56d5351194b50d7a54f6
EntropyInput = b5e4e64500427c4179ced164a7c1ceef997bf79be2308be4d2d6de93f84df58c
Nonce = fbcf3b088a747da6da7bbde530dff956
EntropyInputReseed = 9720cda1ed089335fbae1c164f1d3365830718c75911ba531c5c32bb345682b8
ReturnedBits = 5321fd45d6358a000b0ad02f2c681055
EntropyInput = 0753a23c003521e3d002ec7789c54e189a684b574de233fd84a48919b63f144e
Nonce = 81dc47b03c63430fbe510152758fd898
EntropyInputReseed = 6910ce06d41cd0359191ba2fc9496c65fca83c739c6ebc8fe6c1ae3201794607
ReturnedBits = c3a8803997fdf50d83db358144b5734c
EntropyInput = 3049205795590328e91f36cde0445078656044e731c51cd3ad89f6970cd83e1e
Nonce = 015ec221c3eb47ce8f106620a4f2381f
EntropyInputReseed = 8161c0bfbe411d44c59714e4e3ddf893c0bd5fd97f685fbf171a09faf2ec2557
ReturnedBits = 6e0ed5033952f2eca3d821c6f471e40c
EntropyInput = 4d99b6b82eefeaf6140fedcdb64b73bce59950e0e61bf22610f01fb0a83bf186
Nonce = 194ab49426751ded2e5f40edeadb2722
EntropyInputReseed = ea4412c888a0677e379e15919ec2eaf83a47242e5ecd87806b43be9d4a15f559
ReturnedBits = dbb8d3d1f5b98bda32d621ce3899aab5
EntropyInput = 2bdbc751c7b2cabecc9b43f73cd19ae9c300647211d2e58c79bcc5b9c90810b0
Nonce = 2454a8deba15d74d8061a40b009a137a
EntropyInputReseed = 24c96c6f1d8ee3919cd9f15c452e651a7ad22465d6f7c1f1ee255f984aebcaa5
ReturnedBits = b1e5ccedcbe287df0ab5e4e4aa5e1bf0
EntropyInput = 8fe018fa3b8601d3fb0491251fa35451578e8e262dfdd0aec49eda38d146b7a8
Nonce = 13279303a7135064a0b036b2f6bd56cd
EntropyInputReseed = ce47fbe95b766fe44a7b2ecf59a641b67c8af4e642884a18659cbfddb169434a
ReturnedBits = 91f4da875cc84a8e2280b53ddd500313
EntropyInput = 3def850f1d4d980d8739e8f06ef03132a568f065f498a41a7d05450d508f0394
Nonce = f7eff1802963ecfe0865afe7c272344c
EntropyInputReseed = 3bb701a700c2a34fb0fa0ec1a6d1ebd6ea7df7094e4a4065c8209cb311526ce3
ReturnedBits = 9280835125b9809be8018ceb73602355
EntropyInput = f97d8356d2067bf06536271cbc9b28b3de170345eb305c007a9871df31fed916
Nonce = 3f6b48b294734ec2823e50316990dce0
EntropyInputReseed = 20e26d522556a71822582d0c69b1382df59e2e68c85921c684e78adb4722466d
ReturnedBits = 6cd91222cb3644d5d9b5cee4d7555716
EntropyInput = 17ed8b61ca0ace7f6ee8e84e4ca7490e48e3e2d302f465722d86bfad2d5cd49d
Nonce = 8b9b9f9dc34802793ba0b30fd8913342
EntropyInputReseed = 3d780e508efbdf5969b60a3d1b1fe2f04be4fdfa1e3371638b494fe2fa3f5e44
ReturnedBits = 09db03998f2e29419a8cd6dc0601cf5a
EntropyInput = 039593774cc30fa6a65eec50a3462e03e4aac1ac95370f602980e36f57ae7fa5
Nonce = 0b55cb4b5597c8e9564431892eb88c38
EntropyInputReseed = 1625a66cffd013b41143d971cb8e1954edadfab3558fa63d186987dde23ac1ed
ReturnedBits = 271e09ff58c49c07d81b64e4589abf70
EntropyInput = 765f82533f7e8a0b679da29a36df91d00d0a391cc11119b739e108164a6f2f90
Nonce = 16e0a5548c00b523f9b50c94f2343f08
EntropyInputReseed = 61346ceaa7ab2ac91399400aa40df87ce8931e14b0a0dbff143cd3eca9f17c99
ReturnedBits = 71bad17646cd5cb3c8f6196c6367ef7c

Просмотреть файл

@ -0,0 +1,123 @@
#
#Known answer test vectors for Blockciphers
#
# This file format is based on the FAX files that Atlan gave us with test vectors for FIPS algorithms.
# Many of the test vectors also come from them.
#
# Binary data fields can be one of the following formats
# - string of hex characters
# - Double-quoted string for ASCII strings (no terminating zero is added to the data)
# - 'repeat(<int)' followed by a data field
#
[Rc4]
# test vectors from Wikipedia entry on RC4
key = "Key"
plaintext = "Plaintext"
ciphertext = BBF316E8D940AF0AD3
key = "Wiki"
plaintext = "pedia"
ciphertext = 1021BF0420
key = "Secret"
plaintext = "Attack at dawn"
ciphertext = 45A01F645FC35B383552544B9BF5
rrep = 10000
rnd = 5ac1dc409a945d678026230d7f1b3e86
[ChaCha20]
# test vectors from RFC 7539
# RFC 7539 section 2.4.2
key = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
nonce = 000000000000004a00000000
offset = 64
plaintext = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."
ciphertext = 6e2e359a2568f98041ba0728dd0d6981e97e7aec1d4360c20a27afccfd9fae0bf91b65c5524733ab8f593dabcd62b3571639d624e65152ab8f530c359f0861d807ca0dbf500d6a6156a38e088a22b65e52bc514d16ccf806818ce91ab77937365af90bbf74a35be6b40b8eedf2785e42874d
# RFC 7539 section 2.6.2
key = 808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
nonce = 000000000001020304050607
plaintext = 0000000000000000000000000000000000000000000000000000000000000000
ciphertext = 8ad5a08b905f81cc815040274ab29471a833b637e3fd0da508dbb8e2fdd1a646
# RFC 7539 section 2.8.2
key = 808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
nonce = 070000004041424344454647
plaintext = 0000000000000000000000000000000000000000000000000000000000000000
ciphertext = 7bac2b252db447af09b67a55a4e955840ae1d6731075d9eb2a9375783ed553ff
# RFC 7539 section 2.8.2
key = 808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
nonce = 070000004041424344454647
offset = 64
plaintext = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it."
ciphertext = d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca9671282fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fab324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116
# RFC 7539 appendix A
# A.1 ChaCha20 Block function
# vector #1
key = 0000000000000000000000000000000000000000000000000000000000000000
nonce = 000000000000000000000000
offset = 0
plaintext = repeat(64) 00
ciphertext = 76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586
# vector #2
key = 0000000000000000000000000000000000000000000000000000000000000000
nonce = 000000000000000000000000
offset = 64
plaintext = repeat(64) 00
ciphertext = 9f07e7be5551387a98ba977c732d080dcb0f29a048e3656912c6533e32ee7aed29b721769ce64e43d57133b074d839d531ed1f28510afb45ace10a1f4b794d6f
# vector #3
key = 0000000000000000000000000000000000000000000000000000000000000001
nonce = 000000000000000000000000
offset = 64
plaintext = repeat(64) 00
ciphertext = 3aeb5224ecf849929b9d828db1ced4dd832025e8018b8160b82284f3c949aa5a8eca00bbb4a73bdad192b5c42f73f2fd4e273644c8b36125a64addeb006c13a0
# vector #4
key = 00ff000000000000000000000000000000000000000000000000000000000000
nonce = 000000000000000000000000
offset = 128
plaintext = repeat(64) 00
ciphertext = 72d54dfbf12ec44b362692df94137f328fea8da73990265ec1bbbea1ae9af0ca13b25aa26cb4a648cb9b9d1be65b2c0924a66c54d545ec1b7374f4872e99f096
# vector #5
key = 0000000000000000000000000000000000000000000000000000000000000000
nonce = 000000000000000000000002
offset = 0
plaintext = repeat(64) 00
ciphertext = c2c64d378cd536374ae204b9ef933fcd1a8b2288b3dfa49672ab765b54ee27c78a970e0e955c14f3a88e741b97c286f75f8fc299e8148362fa198a39531bed6d
# A.2 ChaCha20 encryption
# vector #1
# same as A.1 vector #1
# vector #2
key = 0000000000000000000000000000000000000000000000000000000000000001
nonce = 000000000000000000000002
offset = 64
plaintext = 416e79207375626d697373696f6e20746f20746865204945544620696e74656e6465642062792074686520436f6e7472696275746f7220666f72207075626c69636174696f6e20617320616c6c206f722070617274206f6620616e204945544620496e7465726e65742d4472616674206f722052464320616e6420616e792073746174656d656e74206d6164652077697468696e2074686520636f6e74657874206f6620616e204945544620616374697669747920697320636f6e7369646572656420616e20224945544620436f6e747269627574696f6e222e20537563682073746174656d656e747320696e636c756465206f72616c2073746174656d656e747320696e20494554462073657373696f6e732c2061732077656c6c206173207772697474656e20616e6420656c656374726f6e696320636f6d6d756e69636174696f6e73206d61646520617420616e792074696d65206f7220706c6163652c207768696368206172652061646472657373656420746f
ciphertext = a3fbf07df3fa2fde4f376ca23e82737041605d9f4f4f57bd8cff2c1d4b7955ec2a97948bd3722915c8f3d337f7d370050e9e96d647b7c39f56e031ca5eb6250d4042e02785ececfa4b4bb5e8ead0440e20b6e8db09d881a7c6132f420e52795042bdfa7773d8a9051447b3291ce1411c680465552aa6c405b7764d5e87bea85ad00f8449ed8f72d0d662ab052691ca66424bc86d2df80ea41f43abf937d3259dc4b2d0dfb48a6c9139ddd7f76966e928e635553ba76c5c879d7b35d49eb2e62b0871cdac638939e25e8a1e0ef9d5280fa8ca328b351c3c765989cbcf3daa8b6ccc3aaf9f3979c92b3720fc88dc95ed84a1be059c6499b9fda236e7e818b04b0bc39c1e876b193bfe5569753f88128cc08aaa9b63d1a16f80ef2554d7189c411f5869ca52c5b83fa36ff216b9c1d30062bebcfd2dc5bce0911934fda79a86f6e698ced759c3ff9b6477338f3da4f9cd8514ea9982ccafb341b2384dd902f3d1ab7ac61dd29c6f21ba5b862f3730e37cfdc4fd806c22f221
# vector #3
key = 1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0
nonce = 000000000000000000000002
offset = 2688
plaintext = 2754776173206272696c6c69672c20616e642074686520736c6974687920746f7665730a446964206779726520616e642067696d626c6520696e2074686520776162653a0a416c6c206d696d737920776572652074686520626f726f676f7665732c0a416e6420746865206d6f6d65207261746873206f757467726162652e
ciphertext = 62e6347f95ed87a45ffae7426f27a1df5fb69110044c0d73118effa95b01e5cf166d3df2d721caf9b21e5fb14c616871fd84c54f9d65b283196c7fe4f60553ebf39c6402c42234e32a356b3e764312a61a5532055716ead6962568f87d3f3f7704c6a8d1bcd1bf4d50d6154b6da731b187b58dfd728afa36757a797ac188d1
# self-generated long message to allow the tester to find all corner cases on partial and random-access calls
key = 0123456789abcdef00112233445566778899aabbccddeefffedcba9876543210
nonce = 0101020305080d1522375990
plaintext = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
ciphertext = 3b32be72b84caa455f8cf05d4b3661c6a4709079d45430aae0841920232f0cc8be796afc3607e854b4980f94d2cb28f1a5bc2495c3fdfa9a5196fe5ed1b5a9b13461d2f6a93f15a0fdee36d29c316142e206a1fa0958b62e47a0eab2c37d9c6f1b6c73f73fd98bebc7ca8a74a41bb06bd2bed7c15cd2360cd55ee016282b5aaccd383e201e6af58e34b8c4fb3fde4213e67acd2853f15142c762e81ccef46fc8db273f561c52d268e98dccf74d71e8eb76943513a16b5a6d4e56af2a5588a44935c0380e77e8ee1ceada8916f2ed14fff3b58214f1e59e8baff5959dd8745738ac6867c552244b95dd850589b156772af93cad5cc79e97c8d5e4047c6161fd0b1662d6c7f549
rrep = 10000
rnd = 96784c736ee02cae698d9d416c4095ef

99
unittest/kat_xts.dat Normal file
Просмотреть файл

@ -0,0 +1,99 @@
#
# Known answer test vectors for XTS
#
#
[XtsAes]
# test vectors from IEEE 1619-2007
key = 0000000000000000000000000000000000000000000000000000000000000000
tweak = 0
plaintext = 0000000000000000000000000000000000000000000000000000000000000000
ciphertext = 917cf69ebd68b2ec9b9fe9a3eadda692cd43d2f59598ed858c02c2652fbf922e
key = 1111111111111111111111111111111122222222222222222222222222222222
tweak = 0x3333333333
plaintext = 4444444444444444444444444444444444444444444444444444444444444444
ciphertext = c454185e6a16936e39334038acef838bfb186fff7480adc4289382ecd6d394f0
Key = fffefdfcfbfaf9f8f7f6f5f4f3f2f1f022222222222222222222222222222222
tweak = 0x3333333333
plaintext = 4444444444444444444444444444444444444444444444444444444444444444
ciphertext = af85336b597afc1a900b2eb21ec949d292df4c047e0b21532186a5971a227a89
key = 2718281828459045235360287471352631415926535897932384626433832795
tweak = 0
plaintext = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
ciphertext = 27a7479befa1d476489f308cd4cfa6e2a96e4bbe3208ff25287dd3819616e89cc78cf7f5e543445f8333d8fa7f56000005279fa5d8b5e4ad40e736ddb4d35412328063fd2aab53e5ea1e0a9f332500a5df9487d07a5c92cc512c8866c7e860ce93fdf166a24912b422976146ae20ce846bb7dc9ba94a767aaef20c0d61ad02655ea92dc4c4e41a8952c651d33174be51a10c421110e6d81588ede82103a252d8a750e8768defffed9122810aaeb99f9172af82b604dc4b8e51bcb08235a6f4341332e4ca60482a4ba1a03b3e65008fc5da76b70bf1690db4eae29c5f1badd03c5ccf2a55d705ddcd86d449511ceb7ec30bf12b1fa35b913f9f747a8afd1b130e94bff94effd01a91735ca1726acd0b197c4e5b03393697e126826fb6bbde8ecc1e08298516e2c9ed03ff3c1b7860f6de76d4cecd94c8119855ef5297ca67e9f3e7ff72b1e99785ca0a7e7720c5b36dc6d72cac9574c8cbbc2f801e23e56fd344b07f22154beba0f08ce8891e643ed995c94d9a69c9f1b5f499027a78572aeebd74d20cc39881c213ee770b1010e4bea718846977ae119f7a023ab58cca0ad752afe656bb3c17256a9f6e9bf19fdd5a38fc82bbe872c5539edb609ef4f79c203ebb140f2e583cb2ad15b4aa5b655016a8449277dbd477ef2c8d6c017db738b18deb4a427d1923ce3ff262735779a418f20a282df920147beabe421ee5319d0568
key = 2718281828459045235360287471352631415926535897932384626433832795
tweak = 1
plaintext = 27a7479befa1d476489f308cd4cfa6e2a96e4bbe3208ff25287dd3819616e89cc78cf7f5e543445f8333d8fa7f56000005279fa5d8b5e4ad40e736ddb4d35412328063fd2aab53e5ea1e0a9f332500a5df9487d07a5c92cc512c8866c7e860ce93fdf166a24912b422976146ae20ce846bb7dc9ba94a767aaef20c0d61ad02655ea92dc4c4e41a8952c651d33174be51a10c421110e6d81588ede82103a252d8a750e8768defffed9122810aaeb99f9172af82b604dc4b8e51bcb08235a6f4341332e4ca60482a4ba1a03b3e65008fc5da76b70bf1690db4eae29c5f1badd03c5ccf2a55d705ddcd86d449511ceb7ec30bf12b1fa35b913f9f747a8afd1b130e94bff94effd01a91735ca1726acd0b197c4e5b03393697e126826fb6bbde8ecc1e08298516e2c9ed03ff3c1b7860f6de76d4cecd94c8119855ef5297ca67e9f3e7ff72b1e99785ca0a7e7720c5b36dc6d72cac9574c8cbbc2f801e23e56fd344b07f22154beba0f08ce8891e643ed995c94d9a69c9f1b5f499027a78572aeebd74d20cc39881c213ee770b1010e4bea718846977ae119f7a023ab58cca0ad752afe656bb3c17256a9f6e9bf19fdd5a38fc82bbe872c5539edb609ef4f79c203ebb140f2e583cb2ad15b4aa5b655016a8449277dbd477ef2c8d6c017db738b18deb4a427d1923ce3ff262735779a418f20a282df920147beabe421ee5319d0568
ciphertext = 264d3ca8512194fec312c8c9891f279fefdd608d0c027b60483a3fa811d65ee59d52d9e40ec5672d81532b38b6b089ce951f0f9c35590b8b978d175213f329bb1c2fd30f2f7f30492a61a532a79f51d36f5e31a7c9a12c286082ff7d2394d18f783e1a8e72c722caaaa52d8f065657d2631fd25bfd8e5baad6e527d763517501c68c5edc3cdd55435c532d7125c8614deed9adaa3acade5888b87bef641c4c994c8091b5bcd387f3963fb5bc37aa922fbfe3df4e5b915e6eb514717bdd2a74079a5073f5c4bfd46adf7d282e7a393a52579d11a028da4d9cd9c77124f9648ee383b1ac763930e7162a8d37f350b2f74b8472cf09902063c6b32e8c2d9290cefbd7346d1c779a0df50edcde4531da07b099c638e83a755944df2aef1aa31752fd323dcb710fb4bfbb9d22b925bc3577e1b8949e729a90bbafeacf7f7879e7b1147e28ba0bae940db795a61b15ecf4df8db07b824bb062802cc98a9545bb2aaeed77cb3fc6db15dcd7d80d7d5bc406c4970a3478ada8899b329198eb61c193fb6275aa8ca340344a75a862aebe92eee1ce032fd950b47d7704a3876923b4ad62844bf4a09c4dbe8b4397184b7471360c9564880aedddb9baa4af2e75394b08cd32ff479c57a07d3eab5d54de5f9738b8d27f27a9f0ab11799d7b7ffefb2704c95c6ad12c39f1e867a4b7b1d7818a4b753dfd2a89ccb45e001a03a867b187f225dd
key = 2718281828459045235360287471352631415926535897932384626433832795
tweak = 2
plaintext = 264d3ca8512194fec312c8c9891f279fefdd608d0c027b60483a3fa811d65ee59d52d9e40ec5672d81532b38b6b089ce951f0f9c35590b8b978d175213f329bb1c2fd30f2f7f30492a61a532a79f51d36f5e31a7c9a12c286082ff7d2394d18f783e1a8e72c722caaaa52d8f065657d2631fd25bfd8e5baad6e527d763517501c68c5edc3cdd55435c532d7125c8614deed9adaa3acade5888b87bef641c4c994c8091b5bcd387f3963fb5bc37aa922fbfe3df4e5b915e6eb514717bdd2a74079a5073f5c4bfd46adf7d282e7a393a52579d11a028da4d9cd9c77124f9648ee383b1ac763930e7162a8d37f350b2f74b8472cf09902063c6b32e8c2d9290cefbd7346d1c779a0df50edcde4531da07b099c638e83a755944df2aef1aa31752fd323dcb710fb4bfbb9d22b925bc3577e1b8949e729a90bbafeacf7f7879e7b1147e28ba0bae940db795a61b15ecf4df8db07b824bb062802cc98a9545bb2aaeed77cb3fc6db15dcd7d80d7d5bc406c4970a3478ada8899b329198eb61c193fb6275aa8ca340344a75a862aebe92eee1ce032fd950b47d7704a3876923b4ad62844bf4a09c4dbe8b4397184b7471360c9564880aedddb9baa4af2e75394b08cd32ff479c57a07d3eab5d54de5f9738b8d27f27a9f0ab11799d7b7ffefb2704c95c6ad12c39f1e867a4b7b1d7818a4b753dfd2a89ccb45e001a03a867b187f225dd
ciphertext = fa762a3680b76007928ed4a4f49a9456031b704782e65e16cecb54ed7d017b5e18abd67b338e81078f21edb7868d901ebe9c731a7c18b5e6dec1d6a72e078ac9a4262f860beefa14f4e821018272e411a951502b6e79066e84252c3346f3aa62344351a291d4bedc7a07618bdea2af63145cc7a4b8d4070691ae890cd65733e7946e9021a1dffc4c59f159425ee6d50ca9b135fa6162cea18a939838dc000fb386fad086acce5ac07cb2ece7fd580b00cfa5e98589631dc25e8e2a3daf2ffdec26531659912c9d8f7a15e5865ea8fb5816d6207052bd7128cd743c12c8118791a4736811935eb982a532349e31dd401e0b660a568cb1a4711f552f55ded59f1f15bf7196b3ca12a91e488ef59d64f3a02bf45239499ac6176ae321c4a211ec545365971c5d3f4f09d4eb139bfdf2073d33180b21002b65cc9865e76cb24cd92c874c24c18350399a936ab3637079295d76c417776b94efce3a0ef7206b15110519655c956cbd8b2489405ee2b09a6b6eebe0c53790a12a8998378b33a5b71159625f4ba49d2a2fdba59fbf0897bc7aabd8d707dc140a80f0f309f835d3da54ab584e501dfa0ee977fec543f74186a802b9a37adb3e8291eca04d66520d229e60401e7282bef486ae059aa70696e0e305d777140a7a883ecdcb69b9ff938e8a4231864c69ca2c2043bed007ff3e605e014bcf518138dc3a25c5e236171a2d01d6
key = 2718281828459045235360287471352631415926535897932384626433832795
tweak = 0xfd
plaintext = 8e41b78c390b5af9d758bb214a67e9f6bf7727b09ac6124084c37611398fa45daad94868600ed391fb1acd4857a95b466e62ef9f4b377244d1c152e7b30d731aad30c716d214b707aed99eb5b5e580b3e887cf7497465651d4b60e6042051da3693c3b78c14489543be8b6ad0ba629565bba202313ba7b0d0c94a3252b676f46cc02ce0f8a7d34c0ed229129673c1f61aed579d08a9203a25aac3a77e9db60267996db38df637356d9dcd1632e369939f2a29d89345c66e05066f1a3677aef18dea4113faeb629e46721a66d0a7e785d3e29af2594eb67dfa982affe0aac058f6e15864269b135418261fc3afb089472cf68c45dd7f231c6249ba0255e1e033833fc4d00a3fe02132d7bc3873614b8aee34273581ea0325c81f0270affa13641d052d36f0757d484014354d02d6883ca15c24d8c3956b1bd027bcf41f151fd8023c5340e5606f37e90fdb87c86fb4fa634b3718a30bace06a66eaf8f63c4aa3b637826a87fe8cfa44282e92cb1615af3a28e53bc74c7cba1a0977be9065d0c1a5dec6c54ae38d37f37aa35283e048e5530a85c4e7a29d7b92ec0c3169cdf2a805c7604bce60049b9fb7b8eaac10f51ae23794ceba68bb58112e293b9b692ca721b37c662f8574ed4dba6f88e170881c82cddc1034a0ca7e284bf0962b6b26292d836fa9f73c1ac770eef0f2d3a1eaf61d3e03555fd424eedd67e18a18094f888
ciphertext = d55f684f81f4426e9fde92a5ff02df2ac896af63962888a97910c1379e20b0a3b1db613fb7fe2e07004329ea5c22bfd33e3dbe4cf58cc608c2c26c19a2e2fe22f98732c2b5cb844cc6c0702d91e1d50fc4382a7eba5635cd602432a2306ac4ce82f8d70c8d9bc15f918fe71e74c622d5cf71178bf6e0b9cc9f2b41dd8dbe441c41cd0c73a6dc47a348f6702f9d0e9b1b1431e948e299b9ec2272ab2c5f0c7be86affa5dec87a0bee81d3d50007edaa2bcfccb35605155ff36ed8edd4a40dcd4b243acd11b2b987bdbfaf91a7cac27e9c5aea525ee53de7b2d3332c8644402b823e94a7db26276d2d23aa07180f76b4fd29b9c0823099c9d62c519880aee7e9697617c1497d47bf3e571950311421b6b734d38b0db91eb85331b91ea9f61530f54512a5a52a4bad589eb69781d537f23297bb459bdad2948a29e1550bf4787e0be95bb173cf5fab17dab7a13a052a63453d97ccec1a321954886b7a1299faaeecae35c6eaaca753b041b5e5f093bf83397fd21dd6b3012066fcc058cc32c3b09d7562dee29509b5839392c9ff05f51f3166aaac4ac5f238038a3045e6f72e48ef0fe8bc675e82c318a268e43970271bf119b81bf6a982746554f84e72b9f00280a320a08142923c23c883423ff949827f29bbacdc1ccdb04938ce6098c95ba6b32528f4ef78eed778b2e122ddfd1cbdd11d1c0a6783e011fc536d63d053260637
key = 2718281828459045235360287471352631415926535897932384626433832795
tweak = 0xfe
plaintext = d55f684f81f4426e9fde92a5ff02df2ac896af63962888a97910c1379e20b0a3b1db613fb7fe2e07004329ea5c22bfd33e3dbe4cf58cc608c2c26c19a2e2fe22f98732c2b5cb844cc6c0702d91e1d50fc4382a7eba5635cd602432a2306ac4ce82f8d70c8d9bc15f918fe71e74c622d5cf71178bf6e0b9cc9f2b41dd8dbe441c41cd0c73a6dc47a348f6702f9d0e9b1b1431e948e299b9ec2272ab2c5f0c7be86affa5dec87a0bee81d3d50007edaa2bcfccb35605155ff36ed8edd4a40dcd4b243acd11b2b987bdbfaf91a7cac27e9c5aea525ee53de7b2d3332c8644402b823e94a7db26276d2d23aa07180f76b4fd29b9c0823099c9d62c519880aee7e9697617c1497d47bf3e571950311421b6b734d38b0db91eb85331b91ea9f61530f54512a5a52a4bad589eb69781d537f23297bb459bdad2948a29e1550bf4787e0be95bb173cf5fab17dab7a13a052a63453d97ccec1a321954886b7a1299faaeecae35c6eaaca753b041b5e5f093bf83397fd21dd6b3012066fcc058cc32c3b09d7562dee29509b5839392c9ff05f51f3166aaac4ac5f238038a3045e6f72e48ef0fe8bc675e82c318a268e43970271bf119b81bf6a982746554f84e72b9f00280a320a08142923c23c883423ff949827f29bbacdc1ccdb04938ce6098c95ba6b32528f4ef78eed778b2e122ddfd1cbdd11d1c0a6783e011fc536d63d053260637
ciphertext = 72efc1ebfe1ee25975a6eb3aa8589dda2b261f1c85bdab442a9e5b2dd1d7c3957a16fc08e526d4b1223f1b1232a11af274c3d70dac57f83e0983c498f1a6f1aecb021c3e70085a1e527f1ce41ee5911a82020161529cd82773762daf5459de94a0a82adae7e1703c808543c29ed6fb32d9e004327c1355180c995a07741493a09c21ba01a387882da4f62534b87bb15d60d197201c0fd3bf30c1500a3ecfecdd66d8721f90bcc4c17ee925c61b0a03727a9c0d5f5ca462fbfa0af1c2513a9d9d4b5345bd27a5f6e653f751693e6b6a2b8ead57d511e00e58c45b7b8d005af79288f5c7c22fd4f1bf7a898b03a5634c6a1ae3f9fae5de4f296a2896b23e7ed43ed14fa5a2803f4d28f0d3ffcf24757677aebdb47bb388378708948a8d4126ed1839e0da29a537a8c198b3c66ab00712dd261674bf45a73d67f76914f830ca014b65596f27e4cf62de66125a5566df9975155628b400fbfb3a29040ed50faffdbb18aece7c5c44693260aab386c0a37b11b114f1c415aebb653be468179428d43a4d8bc3ec38813eca30a13cf1bb18d524f1992d44d8b1a42ea30b22e6c95b199d8d182f8840b09d059585c31ad691fa0619ff038aca2c39a943421157361717c49d322028a74648113bd8c9d7ec77cf3c89c1ec8718ceff8516d96b34c3c614f10699c9abc4ed0411506223bea16af35c883accdbe1104eef0cfdb54e12fb230a
key = 2718281828459045235360287471352631415926535897932384626433832795
tweak = 0xff
plaintext = 72efc1ebfe1ee25975a6eb3aa8589dda2b261f1c85bdab442a9e5b2dd1d7c3957a16fc08e526d4b1223f1b1232a11af274c3d70dac57f83e0983c498f1a6f1aecb021c3e70085a1e527f1ce41ee5911a82020161529cd82773762daf5459de94a0a82adae7e1703c808543c29ed6fb32d9e004327c1355180c995a07741493a09c21ba01a387882da4f62534b87bb15d60d197201c0fd3bf30c1500a3ecfecdd66d8721f90bcc4c17ee925c61b0a03727a9c0d5f5ca462fbfa0af1c2513a9d9d4b5345bd27a5f6e653f751693e6b6a2b8ead57d511e00e58c45b7b8d005af79288f5c7c22fd4f1bf7a898b03a5634c6a1ae3f9fae5de4f296a2896b23e7ed43ed14fa5a2803f4d28f0d3ffcf24757677aebdb47bb388378708948a8d4126ed1839e0da29a537a8c198b3c66ab00712dd261674bf45a73d67f76914f830ca014b65596f27e4cf62de66125a5566df9975155628b400fbfb3a29040ed50faffdbb18aece7c5c44693260aab386c0a37b11b114f1c415aebb653be468179428d43a4d8bc3ec38813eca30a13cf1bb18d524f1992d44d8b1a42ea30b22e6c95b199d8d182f8840b09d059585c31ad691fa0619ff038aca2c39a943421157361717c49d322028a74648113bd8c9d7ec77cf3c89c1ec8718ceff8516d96b34c3c614f10699c9abc4ed0411506223bea16af35c883accdbe1104eef0cfdb54e12fb230a
ciphertext = 3260ae8dad1f4a32c5cafe3ab0eb95549d461a67ceb9e5aa2d3afb62dece0553193ba50c75be251e08d1d08f1088576c7efdfaaf3f459559571e12511753b07af073f35da06af0ce0bbf6b8f5ccc5cea500ec1b211bd51f63b606bf6528796ca12173ba39b8935ee44ccce646f90a45bf9ccc567f0ace13dc2d53ebeedc81f58b2e41179dddf0d5a5c42f5d8506c1a5d2f8f59f3ea873cbcd0eec19acbf325423bd3dcb8c2b1bf1d1eaed0eba7f0698e4314fbeb2f1566d1b9253008cbccf45a2b0d9c5c9c21474f4076e02be26050b99dee4fd68a4cf890e496e4fcae7b70f94ea5a9062da0daeba1993d2ccd1dd3c244b8428801495a58b216547e7e847c46d1d756377b6242d2e5fb83bf752b54e0df71e889f3a2bb0f4c10805bf3c590376e3c24e22ff57f7fa965577375325cea5d920db94b9c336b455f6e894c01866fe9fbb8c8d3f70a2957285f6dfb5dcd8cbf54782f8fe7766d4723819913ac773421e3a31095866bad22c86a6036b2518b2059b4229d18c8c2ccbdf906c6cc6e82464ee57bddb0bebcb1dc645325bfb3e665ef7251082c88ebb1cf203bd779fdd38675713c8daadd17e1cabee432b09787b6ddf3304e38b731b45df5df51b78fcfb3d32466028d0ba36555e7e11ab0ee0666061d1645d962444bc47a38188930a84b4d561395c73c087021927ca638b7afc8a8679ccb84c26555440ec7f10445cd
key = 27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592
tweak = 0xff
plaintext = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
ciphertext = 1c3b3a102f770386e4836c99e370cf9bea00803f5e482357a4ae12d414a3e63b5d31e276f8fe4a8d66b317f9ac683f44680a86ac35adfc3345befecb4bb188fd5776926c49a3095eb108fd1098baec70aaa66999a72a82f27d848b21d4a741b0c5cd4d5fff9dac89aeba122961d03a757123e9870f8acf1000020887891429ca2a3e7a7d7df7b10355165c8b9a6d0a7de8b062c4500dc4cd120c0f7418dae3d0b5781c34803fa75421c790dfe1de1834f280d7667b327f6c8cd7557e12ac3a0f93ec05c52e0493ef31a12d3d9260f79a289d6a379bc70c50841473d1a8cc81ec583e9645e07b8d9670655ba5bbcfecc6dc3966380ad8fecb17b6ba02469a020a84e18e8f84252070c13e9f1f289be54fbc481457778f616015e1327a02b140f1505eb309326d68378f8374595c849d84f4c333ec4423885143cb47bd71c5edae9be69a2ffeceb1bec9de244fbe15992b11b77c040f12bd8f6a975a44a0f90c29a9abc3d4d893927284c58754cce294529f8614dcd2aba991925fedc4ae74ffac6e333b93eb4aff0479da9a410e4450e0dd7ae4c6e2910900575da401fc07059f645e8b7e9bfdef33943054ff84011493c27b3429eaedb4ed5376441a77ed43851ad77f16f541dfd269d50d6a5f14fb0aab1cbb4c1550be97f7ab4066193c4caa773dad38014bd2092fa755c824bb5e54c4f36ffda9fcea70b9c6e693e148c151
key = 27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592
tweak = 0xffff
plaintext = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
ciphertext = 77a31251618a15e6b92d1d66dffe7b50b50bad552305ba0217a610688eff7e11e1d0225438e093242d6db274fde801d4cae06f2092c728b2478559df58e837c2469ee4a4fa794e4bbc7f39bc026e3cb72c33b0888f25b4acf56a2a9804f1ce6d3d6e1dc6ca181d4b546179d55544aa7760c40d06741539c7e3cd9d2f6650b2013fd0eeb8c2b8e3d8d240ccae2d4c98320a7442e1c8d75a42d6e6cfa4c2eca1798d158c7aecdf82490f24bb9b38e108bcda12c3faf9a21141c3613b58367f922aaa26cd22f23d708dae699ad7cb40a8ad0b6e2784973dcb605684c08b8d6998c69aac049921871ebb65301a4619ca80ecb485a31d744223ce8ddc2394828d6a80470c092f5ba413c3378fa6054255c6f9df4495862bbb3287681f931b687c888abf844dfc8fc28331e579928cd12bd2390ae123cf03818d14dedde5c0c24c8ab018bfca75ca096f2d531f3d1619e785f1ada437cab92e980558b3dce1474afb75bfedbf8ff54cb2618e0244c9ac0d3c66fb51598cd2db11f9be39791abe447c63094f7c453b7ff87cb5bb36b7c79efb0872d17058b83b15ab0866ad8a58656c5a7e20dbdf308b2461d97c0ec0024a2715055249cf3b478ddd4740de654f75ca686e0d7345c69ed50cdc2a8b332b1f8824108ac937eb050585608ee734097fc09054fbff89eeaeea791f4a7ab1f9868294a4f9e27b42af8100cb9d59cef9645803
key = 27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592
tweak = 0xffffff
plaintext = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
ciphertext = e387aaa58ba483afa7e8eb469778317ecf4cf573aa9d4eac23f2cdf914e4e200a8b490e42ee646802dc6ee2b471b278195d60918ececb44bf79966f83faba0499298ebc699c0c8634715a320bb4f075d622e74c8c932004f25b41e361025b5a87815391f6108fc4afa6a05d9303c6ba68a128a55705d415985832fdeaae6c8e19110e84d1b1f199a2692119edc96132658f09da7c623efcec712537a3d94c0bf5d7e352ec94ae5797fdb377dc1551150721adf15bd26a8efc2fcaad56881fa9e62462c28f30ae1ceaca93c345cf243b73f542e2074a705bd2643bb9f7cc79bb6e7091ea6e232df0f9ad0d6cf502327876d82207abf2115cdacf6d5a48f6c1879a65b115f0f8b3cb3c59d15dd8c769bc014795a1837f3901b5845eb491adfefe097b1fa30a12fc1f65ba22905031539971a10f2f36c321bb51331cdefb39e3964c7ef079994f5b69b2edd83a71ef549971ee93f44eac3938fcdd61d01fa71799da3a8091c4c48aa9ed263ff0749df95d44fef6a0bb578ec69456aa5408ae32c7af08ad7ba8921287e3bbee31b767be06a0e705c864a769137df28292283ea81a2480241b44d9921cdbec1bc28dc1fda114bd8e5217ac9d8ebafa720e9da4f9ace231cc949e5b96fe76ffc21063fddc83a6b8679c00d35e09576a875305bed5f36ed242c8900dd1fa965bc950dfce09b132263a1eef52dd6888c309f5a7d712826
key = 27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592
tweak = 0xffffffff
plaintext = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
ciphertext = bf53d2dade78e822a4d949a9bc6766b01b06a8ef70d26748c6a7fc36d80ae4c5520f7c4ab0ac8544424fa405162fef5a6b7f229498063618d39f0003cb5fb8d1c86b643497da1ff945c8d3bedeca4f479702a7a735f043ddb1d6aaade3c4a0ac7ca7f3fa5279bef56f82cd7a2f38672e824814e10700300a055e1630b8f1cb0e919f5e942010a416e2bf48cb46993d3cb6a51c19bacf864785a00bc2ecff15d350875b246ed53e68be6f55bd7e05cfc2b2ed6432198a6444b6d8c247fab941f569768b5c429366f1d3f00f0345b96123d56204c01c63b22ce78baf116e525ed90fdea39fa469494d3866c31e05f295ff21fea8d4e6e13d67e47ce722e9698a1c1048d68ebcde76b86fcf976eab8aa9790268b7068e017a8b9b749409514f1053027fd16c3786ea1bac5f15cb79711ee2abe82f5cf8b13ae73030ef5b9e4457e75d1304f988d62dd6fc4b94ed38ba831da4b7634971b6cd8ec325d9c61c00f1df73627ed3745a5e8489f3a95c69639c32cd6e1d537a85f75cc844726e8a72fc0077ad22000f1d5078f6b866318c668f1ad03d5a5fced5219f2eabbd0aa5c0f460d183f04404a0d6f469558e81fab24a167905ab4c7878502ad3e38fdbe62a41556cec37325759533ce8f25f367c87bb5578d667ae93f9e2fd99bcbc5f2fbba88cf6516139420fcff3b7361d86322c4bd84c82f335abb152c4a93411373aaa8220
key = 27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592
tweak = 0xffffffffff
plaintext = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
ciphertext = 64497e5a831e4a932c09be3e5393376daa599548b816031d224bbf50a818ed2350eae7e96087c8a0db51ad290bd00c1ac1620857635bf246c176ab463be30b808da548081ac847b158e1264be25bb0910bbc92647108089415d45fab1b3d2604e8a8eff1ae4020cfa39936b66827b23f371b92200be90251e6d73c5f86de5fd4a950781933d79a28272b782a2ec313efdfcc0628f43d744c2dc2ff3dcb66999b50c7ca895b0c64791eeaa5f29499fb1c026f84ce5b5c72ba1083cddb5ce45434631665c333b60b11593fb253c5179a2c8db813782a004856a1653011e93fb6d876c18366dd8683f53412c0c180f9c848592d593f8609ca736317d356e13e2bff3a9f59cd9aeb19cd482593d8c46128bb32423b37a9adfb482b99453fbe25a41bf6feb4aa0bef5ed24bf73c762978025482c13115e4015aac992e5613a3b5c2f685b84795cb6e9b2656d8c88157e52c42f978d8634c43d06fea928f2822e465aa6576e9bf419384506cc3ce3c54ac1a6f67dc66f3b30191e698380bc999b05abce19dc0c6dcc2dd001ec535ba18deb2df1a101023108318c75dc98611a09dc48a0acdec676fabdf222f07e026f059b672b56e5cbc8e1d21bbd867dd927212054681d70ea737134cdfce93b6f82ae22423274e58a0821cc5502e2d0ab4585e94de6975be5e0b4efce51cd3e70c25a1fbbbd609d273ad5b0d59631c531f6a0a57b9
keylen = 32
rrep = 1000
rnd = dd1f47494f4525243821941d747f214c
keylen = 48
rrep = 1000
rnd = 4600e05f9423a8113a9bd9b5e1dcd54a
keylen = 64
rrep = 1000
rnd = fa53f99f6d3bf38affd12bb6b527a46b

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше