// test mod_L() // #include #include #include #include "impl.h" #define SIZE 130 // 512-bit hex strings have length 128 + '\n' + '\0' int main( void) { char wstr[SIZE], astr[SIZE]; E e; D w, a; int count = 0; printf( "CONSTANT_TIME = %i\n", CONSTANT_TIME); // input w and w mod L // while( fgets( wstr, SIZE, stdin) && fgets( astr, SIZE, stdin) ) { ++count; printf( "case %i\n", count); convert_D( w, wstr); print( "w", w, NN); // e = w = w mod L // mod_L( e, w); print_E( "e", e, N); print( "w", w, NN); convert_D( a, astr); print( "a", a, NN); if( memcmp( w, a, sizeof(w)) == 0) printf( "case %i pass\n", count); else printf( "case %i fail\n", count); } return 0; }