]> git.cryptolib.org Git - avr-crypto-lib.git/blob - noekeon_genrc.c
+RC5 +size-statistics tool +small modification to nessie_bc_test (optional free(...
[avr-crypto-lib.git] / noekeon_genrc.c
1 /**
2  *
3  * author: Daniel Otte
4  * email:  daniel.otte@rub.de
5  * license: GPLv3
6  *
7  */
8
9 #include <stdio.h>
10 #include <stdint.h>
11
12 uint8_t getnextrc(uint8_t a){
13         if((a&0x80) != 0){
14                 return (a<<1) ^ 0x1B;
15         } else {
16                 return (a<<1);
17         }
18 }
19
20 #define N 32
21
22 int main(void){
23         uint8_t c=0x80;
24         uint32_t i;
25         puts("\nNoekeon Round Constants:");
26         for(i=0; i<N; ++i){
27                 printf(" 0x%2.2X,", c);
28                 if(i%8==7){
29                         puts("");
30                 }
31                 c=getnextrc(c);
32         }
33         return 0;
34 }
35