diff --git a/README.md b/README.md new file mode 100644 index 0000000..8408ee0 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# openSSL-DICE +Simulated implementation of DICE based on microsoft paper on dice n riot. initial implementation, later to be implemented on Jetson Xavior + + +Step 1 - skeletal setup + +sketch roadmap of dataflow, +lable functions, +locate input and output DS, +find appropriate openssl fns, + + + +Step 2 - codify + +use static value for ids, eg UDS, FW, + + + + +Step 3 - replace static IDs with real values + +use real values from device? use rng? diff --git a/trial1/fun1.c b/trial1/fun1.c new file mode 100644 index 0000000..a8f7227 --- /dev/null +++ b/trial1/fun1.c @@ -0,0 +1,8 @@ +#include "fun1.h" + +int fun1() +{ + printf("Hello from FN1\n"); +// fun2(); + return 0; +} diff --git a/trial1/fun1.h b/trial1/fun1.h new file mode 100644 index 0000000..6914137 --- /dev/null +++ b/trial1/fun1.h @@ -0,0 +1,5 @@ +#include + + + +int fun1(); diff --git a/trial1/include/fun2.c b/trial1/include/fun2.c new file mode 100644 index 0000000..3c6b92d --- /dev/null +++ b/trial1/include/fun2.c @@ -0,0 +1,8 @@ +#include "fun2.h" + +int fun2() +{ + printf("Hello from FN2\n"); + return 0; +} + diff --git a/trial1/include/fun2.h b/trial1/include/fun2.h new file mode 100644 index 0000000..77ca2fd --- /dev/null +++ b/trial1/include/fun2.h @@ -0,0 +1 @@ +int fun2(); diff --git a/trial1/main b/trial1/main new file mode 100644 index 0000000..bdd6dea Binary files /dev/null and b/trial1/main differ diff --git a/trial1/main.c b/trial1/main.c new file mode 100644 index 0000000..4912601 --- /dev/null +++ b/trial1/main.c @@ -0,0 +1,9 @@ +#include "fun1.h" + +int main() +{ + printf("Hello World\n"); + fun1(); + return 0; +} + diff --git a/trial1/makefile b/trial1/makefile new file mode 100644 index 0000000..1f9fc3a --- /dev/null +++ b/trial1/makefile @@ -0,0 +1,19 @@ +CC=gcc +IDIR=./include +LDIR=./lib +ODIR=./out +_DEPS = fun1.h +DEPS = $(pathsbst %,(IDIR)/%,%(_DEPS)) + + +CFLAGS= -I. -T$(IDIR) + + +.PHONY: all clean + +all: main.c fun1.c + ${CC} -o $(ODIR)/main2 main.c fun1.c + +clean: + rm -r $(ODIR)/* + rm -r ./keys/* diff --git a/trial1/out/main2 b/trial1/out/main2 new file mode 100644 index 0000000..bdd6dea Binary files /dev/null and b/trial1/out/main2 differ diff --git a/trial2/include/hellomake.h b/trial2/include/hellomake.h new file mode 100644 index 0000000..fccca1b --- /dev/null +++ b/trial2/include/hellomake.h @@ -0,0 +1 @@ +void myPrintHelloMake(void); diff --git a/trial2/src/hellofunc.c b/trial2/src/hellofunc.c new file mode 100644 index 0000000..356ffa7 --- /dev/null +++ b/trial2/src/hellofunc.c @@ -0,0 +1,9 @@ +#include +#include + +void myPrintHelloMake(void) { + + printf("Hello makefiles!\n"); + + return; +} diff --git a/trial2/src/hellomake b/trial2/src/hellomake new file mode 100644 index 0000000..390cb17 Binary files /dev/null and b/trial2/src/hellomake differ diff --git a/trial2/src/hellomake.c b/trial2/src/hellomake.c new file mode 100644 index 0000000..3d673b7 --- /dev/null +++ b/trial2/src/hellomake.c @@ -0,0 +1,8 @@ +#include + +int main() { + // call a function in another file + myPrintHelloMake(); + + return(0); +} diff --git a/trial2/src/makefile b/trial2/src/makefile new file mode 100644 index 0000000..95561df --- /dev/null +++ b/trial2/src/makefile @@ -0,0 +1,26 @@ +IDIR =../include +CC=gcc +CFLAGS=-I$(IDIR) + +ODIR=obj +LDIR =../lib + +LIBS=-lm + +_DEPS = hellomake.h +DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS)) + +_OBJ = hellomake.o hellofunc.o +OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ)) + + +$(ODIR)/%.o: %.c $(DEPS) + $(CC) -c -o $@ $< $(CFLAGS) + +hellomake: $(OBJ) + $(CC) -o $@ $^ $(CFLAGS) $(LIBS) + +.PHONY: clean + +clean: + rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~ diff --git a/trial2/src/obj/hellofunc.o b/trial2/src/obj/hellofunc.o new file mode 100644 index 0000000..7f46741 Binary files /dev/null and b/trial2/src/obj/hellofunc.o differ diff --git a/trial2/src/obj/hellomake.o b/trial2/src/obj/hellomake.o new file mode 100644 index 0000000..2526b2e Binary files /dev/null and b/trial2/src/obj/hellomake.o differ