#include "memxor.h"
//#ifndef TWISTER_MUL_TABLE
-# include "gf256mul.h"
+# include "gf256mul/gf256mul.h"
//#endif
#define MDS(a,b) pgm_read_byte(&(twister_mds[(a)][(b)]))
# define MULT(a,b) gf256mul((a),(b), 0x4D)
//#endif
-void twister_blank_round(twister_state_t* ctx){
+void twister_blank_round(twister_state_t *ctx){
uint8_t i,j,k;
uint8_t tmp[8][8];
/* add twist counter */
}
}
}
-void twister_mini_round(twister_state_t* ctx, const void* msg){
+void twister_mini_round(twister_state_t *ctx, const void *msg){
/* inject message */
uint8_t i;
for(i=0; i<8; ++i){
twister_blank_round(ctx);
}
-void twister_ctx2hash(void* dest, twister_state_t* ctx, uint16_t hashsize_b){
+void twister_ctx2hash(void *dest, twister_state_t *ctx, uint16_t hashsize_b){
uint8_t tmp[8][8];
uint8_t j;
uint16_t i=hashsize_b;
memxor(ctx->s, tmp, 64);
twister_blank_round(ctx);
for(j=0; j<4; ++j){
- *((uint8_t*)dest) = ctx->s[3-j][0] ^ tmp[3-j][0];
+ *((uint8_t*)dest) = ctx->s[7-j][0] ^ tmp[7-j][0];
dest = (uint8_t*)dest + 1;
}
}