From 7ce0cfaf621e263fc99e59e86b3e0446b0256834 Mon Sep 17 00:00:00 2001 From: bg Date: Tue, 1 Feb 2011 12:41:01 +0100 Subject: [PATCH] =?UTF-8?q?Gr=C3=B8stl=20adapted=20for=20round=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- groestl/groestl_large.c | 48 +- groestl/groestl_small.c | 43 +- .../ExtremelyLongMsgKAT_224.txt | 7 + .../ExtremelyLongMsgKAT_256.txt | 7 + .../ExtremelyLongMsgKAT_384.txt | 7 + .../ExtremelyLongMsgKAT_512.txt | 7 + .../IntermediateValues_1BlockMsg_224.txt | 1181 ++ .../IntermediateValues_1BlockMsg_256.txt | 1181 ++ .../IntermediateValues_1BlockMsg_384.txt | 1613 ++ .../IntermediateValues_1BlockMsg_512.txt | 1613 ++ .../IntermediateValues_2BlockMsg_224.txt | 1948 ++ .../IntermediateValues_2BlockMsg_256.txt | 1948 ++ .../IntermediateValues_2BlockMsg_384.txt | 2668 +++ .../IntermediateValues_2BlockMsg_512.txt | 2668 +++ .../shavs/Groestl-round2/LongMsgKAT_224.txt | 1543 ++ .../shavs/Groestl-round2/LongMsgKAT_256.txt | 1543 ++ .../shavs/Groestl-round2/LongMsgKAT_384.txt | 1543 ++ .../shavs/Groestl-round2/LongMsgKAT_512.txt | 1543 ++ .../shavs/Groestl-round2/MonteCarlo_224.txt | 305 + .../shavs/Groestl-round2/MonteCarlo_256.txt | 305 + .../shavs/Groestl-round2/MonteCarlo_384.txt | 305 + .../shavs/Groestl-round2/MonteCarlo_512.txt | 305 + .../shavs/Groestl-round2/ShortMsgKAT_224.txt | 8195 ++++++++ .../shavs/Groestl-round2/ShortMsgKAT_256.txt | 8195 ++++++++ .../shavs/Groestl-round2/ShortMsgKAT_384.txt | 8195 ++++++++ .../shavs/Groestl-round2/ShortMsgKAT_512.txt | 8195 ++++++++ .../shavs/Groestl/ExtremelyLongMsgKAT_224.txt | 14 +- .../shavs/Groestl/ExtremelyLongMsgKAT_256.txt | 14 +- .../shavs/Groestl/ExtremelyLongMsgKAT_384.txt | 14 +- .../shavs/Groestl/ExtremelyLongMsgKAT_512.txt | 14 +- .../IntermediateValues_1BlockMsg_224.txt | 2362 +-- .../IntermediateValues_1BlockMsg_256.txt | 2362 +-- .../IntermediateValues_1BlockMsg_384.txt | 3226 +-- .../IntermediateValues_1BlockMsg_512.txt | 3226 +-- .../IntermediateValues_2BlockMsg_224.txt | 3896 ++-- .../IntermediateValues_2BlockMsg_256.txt | 3896 ++-- .../IntermediateValues_2BlockMsg_384.txt | 5336 ++--- .../IntermediateValues_2BlockMsg_512.txt | 5336 ++--- testvectors/shavs/Groestl/LongMsgKAT_224.txt | 3086 +-- testvectors/shavs/Groestl/LongMsgKAT_256.txt | 3086 +-- testvectors/shavs/Groestl/LongMsgKAT_384.txt | 3086 +-- testvectors/shavs/Groestl/LongMsgKAT_512.txt | 3086 +-- testvectors/shavs/Groestl/MonteCarlo_224.txt | 610 +- testvectors/shavs/Groestl/MonteCarlo_256.txt | 610 +- testvectors/shavs/Groestl/MonteCarlo_384.txt | 610 +- testvectors/shavs/Groestl/MonteCarlo_512.txt | 610 +- testvectors/shavs/Groestl/ShortMsgKAT_224.txt | 16390 ++++++++-------- testvectors/shavs/Groestl/ShortMsgKAT_256.txt | 16390 ++++++++-------- testvectors/shavs/Groestl/ShortMsgKAT_384.txt | 16390 ++++++++-------- testvectors/shavs/Groestl/ShortMsgKAT_512.txt | 16390 ++++++++-------- 50 files changed, 110110 insertions(+), 55041 deletions(-) create mode 100644 testvectors/shavs/Groestl-round2/ExtremelyLongMsgKAT_224.txt create mode 100644 testvectors/shavs/Groestl-round2/ExtremelyLongMsgKAT_256.txt create mode 100644 testvectors/shavs/Groestl-round2/ExtremelyLongMsgKAT_384.txt create mode 100644 testvectors/shavs/Groestl-round2/ExtremelyLongMsgKAT_512.txt create mode 100644 testvectors/shavs/Groestl-round2/IntermediateValues_1BlockMsg_224.txt create mode 100644 testvectors/shavs/Groestl-round2/IntermediateValues_1BlockMsg_256.txt create mode 100644 testvectors/shavs/Groestl-round2/IntermediateValues_1BlockMsg_384.txt create mode 100644 testvectors/shavs/Groestl-round2/IntermediateValues_1BlockMsg_512.txt create mode 100644 testvectors/shavs/Groestl-round2/IntermediateValues_2BlockMsg_224.txt create mode 100644 testvectors/shavs/Groestl-round2/IntermediateValues_2BlockMsg_256.txt create mode 100644 testvectors/shavs/Groestl-round2/IntermediateValues_2BlockMsg_384.txt create mode 100644 testvectors/shavs/Groestl-round2/IntermediateValues_2BlockMsg_512.txt create mode 100644 testvectors/shavs/Groestl-round2/LongMsgKAT_224.txt create mode 100644 testvectors/shavs/Groestl-round2/LongMsgKAT_256.txt create mode 100644 testvectors/shavs/Groestl-round2/LongMsgKAT_384.txt create mode 100644 testvectors/shavs/Groestl-round2/LongMsgKAT_512.txt create mode 100644 testvectors/shavs/Groestl-round2/MonteCarlo_224.txt create mode 100644 testvectors/shavs/Groestl-round2/MonteCarlo_256.txt create mode 100644 testvectors/shavs/Groestl-round2/MonteCarlo_384.txt create mode 100644 testvectors/shavs/Groestl-round2/MonteCarlo_512.txt create mode 100644 testvectors/shavs/Groestl-round2/ShortMsgKAT_224.txt create mode 100644 testvectors/shavs/Groestl-round2/ShortMsgKAT_256.txt create mode 100644 testvectors/shavs/Groestl-round2/ShortMsgKAT_384.txt create mode 100644 testvectors/shavs/Groestl-round2/ShortMsgKAT_512.txt diff --git a/groestl/groestl_large.c b/groestl/groestl_large.c index 0650196..a1e962c 100644 --- a/groestl/groestl_large.c +++ b/groestl/groestl_large.c @@ -64,14 +64,43 @@ static const uint8_t matrix[] = { 2, 3, 4, 5, 3, 5, 7, 2 }; +static +void shift_columns(uint8_t* a, const uint8_t *shifts){ + uint8_t tmp[16]; + uint8_t i,j,s; + for(i=0; i<8; ++i){ + s = *shifts++; + if(s==0){ + continue; + } + for(j=0;j<16;++j){ + tmp[j] = a[i+j*8]; + } + for(j=0;j<16;++j){ + a[i+((j-s+16)%16)*8] = tmp[j]; + } + } +} + +static const uint8_t p_shifts[8] = { 0, 1, 2, 3, 4, 5, 6, 11 }; +static const uint8_t q_shifts[8] = { 1, 3, 5, 11, 0, 2, 4, 6 }; + +static void groestl_large_rounds(uint8_t *m, uint8_t q){ uint8_t r,i,j; uint8_t tmp[16]; for(r=0; r