Commit 472a0e03 authored by David Monniaux's avatar David Monniaux
Browse files

same format as the others

parent b8a398d3
all:
$(CC) -Wall -O2 -D__BSTEA_MAIN_ -o bstea_test bstea_test.c bstea.c
CFLAGS=-Wall -O3
K1C_CC=k1-mbr-gcc
K1C_CFLAGS=-Wall -O3 -std=c99
K1C_CCOMP=../../../ccomp
K1C_CCOMPFLAGS=-Wall -O3 -D__thread= -D__int128=int
PRODUCTS=bstea.host bstea.gcc.k1c.out bstea.ccomp.k1c.out bstea.ccomp.k1c.s bstea.gcc.k1c.s bstea.gcc.k1c bstea.ccomp.k1c
all: $(PRODUCTS)
%.gcc.k1c.s: %.c
$(K1C_CC) $(K1C_CFLAGS) -S $< -o $@
%.gcc.k1c.o: %.gcc.k1c.s
$(K1C_CC) $(K1C_CFLAGS) -c $< -o $@
%.ccomp.k1c.s: %.c
$(K1C_CCOMP) $(K1C_CCOMPFLAGS) -S $< -o $@
%.ccomp.k1c.o: %.ccomp.k1c.s
$(K1C_CCOMP) $(K1C_CCOMPFLAGS) -c $< -o $@
bstea.host: bstea.c bstea_run.c bstea.h ../clock.c
$(CC) $(CFLAGS) bstea.c bstea_run.c ../clock.c -o $@
bstea.gcc.k1c.s bstea.ccomp.k1c.s bstea_run.gcc.k1c.s: bstea.h
bstea.gcc.k1c: bstea.gcc.k1c.o bstea_run.gcc.k1c.o ../clock.gcc.k1c.o
$(K1C_CC) $(K1C_CFLAGS) $+ -o $@
bstea.ccomp.k1c: bstea.ccomp.k1c.o bstea_run.gcc.k1c.o ../clock.gcc.k1c.o
$(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@
%.k1c.out: %.k1c
k1-cluster --cycle-based -- $< | tee $@
clean:
rm -f bstea_test
$(RM) -f $(PRODUCTS) bstea.gcc.k1c.o bstea.ccomp.k1c.o bstea_run.gcc.k1c.o bstea_run.gcc.k1c.s
.PHONY: clean
......@@ -4,7 +4,7 @@
#include "bstea.h"
#include "../clock.h"
/* pack and unpack a single value all over the data path */
static void pack(uint32_t *v, size_t len, vector_width_t *bv) {
......@@ -71,6 +71,8 @@ static void test_vectors() {
0x41ea3a0a, 0x4e8e7829} } };
for (i = 0; i < sizeof(testv)/sizeof(tvector_t); ++i) {
clock_start();
for (j = 0;j < TEA_BLOCK_SIZE;++j) v[j] = 0;
for (j = 0;j < TEA_KEY_SIZE;++j) k[j] = 0;
......@@ -108,17 +110,14 @@ static void test_vectors() {
&& testv[i].key[2] == key[2] \
&& testv[i].key[3] == key[3] );
clock_stop();
printf("test vector, %i,\t[PASSED]\n", i);
}
}
#ifdef __BSTEA_MAIN_
int main(int argc, char *argv[]) {
test_vectors();
print_total_clock();
return 0;
}
#endif /* __BSTEA_MAIN_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment