--- /dev/null
+#include <stdint.h>
+
+void memxor(void * dest, const void * src, uint16_t n){
+ while(n--){
+ ((uint8_t*)dest)[n] ^= ((uint8_t*)src)[n];
+ }
+}
+
--- /dev/null
+#ifndef MEMXOR_H_
+#define MEMXOR_H_
+#include <stdint.h>
+
+void memxor(void * dest, const void * src, uint16_t n);
+
+#endif
$(ALGO_NAME)_OBJ := shabea.o sha256-asm.o
$(ALGO_NAME)_TEST_BIN := main-shabea-test.o debug.o uart.o serial-tools.o \
shabea.o sha256-asm.o nessie_bc_test.o \
- nessie_common.o cli.o performance_test.o
+ nessie_common.o cli.o performance_test.o memxor.o
$(ALGO_NAME)_NESSIE_TEST := "nessie"
$(ALGO_NAME)_PEROFRMANCE_TEST := "performance"
#include "config.h"
#include "uart.h"
#include "debug.h"
-/*
- *
- */
-void memxor(uint8_t * dest, uint8_t * src, uint8_t length){
- while(length--){
- *dest++ ^= *src++;
- }
-}
+#include "memxor.h"
+
/*
* SHABEA256-n
memcpy(R, hash, HALFSIZEB);
} else {
/* no swap */
- memxor(L, hash, HALFSIZE);
+ memxor(L, hash, HALFSIZEB);
}
}
}