added t1 t2 and readme
This commit is contained in:
parent
77d02fc093
commit
778bbe1ff2
23
README.md
Normal file
23
README.md
Normal file
@ -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?
|
8
trial1/fun1.c
Normal file
8
trial1/fun1.c
Normal file
@ -0,0 +1,8 @@
|
||||
#include "fun1.h"
|
||||
|
||||
int fun1()
|
||||
{
|
||||
printf("Hello from FN1\n");
|
||||
// fun2();
|
||||
return 0;
|
||||
}
|
5
trial1/fun1.h
Normal file
5
trial1/fun1.h
Normal file
@ -0,0 +1,5 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
int fun1();
|
8
trial1/include/fun2.c
Normal file
8
trial1/include/fun2.c
Normal file
@ -0,0 +1,8 @@
|
||||
#include "fun2.h"
|
||||
|
||||
int fun2()
|
||||
{
|
||||
printf("Hello from FN2\n");
|
||||
return 0;
|
||||
}
|
||||
|
1
trial1/include/fun2.h
Normal file
1
trial1/include/fun2.h
Normal file
@ -0,0 +1 @@
|
||||
int fun2();
|
BIN
trial1/main
Normal file
BIN
trial1/main
Normal file
Binary file not shown.
9
trial1/main.c
Normal file
9
trial1/main.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include "fun1.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Hello World\n");
|
||||
fun1();
|
||||
return 0;
|
||||
}
|
||||
|
19
trial1/makefile
Normal file
19
trial1/makefile
Normal file
@ -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/*
|
BIN
trial1/out/main2
Normal file
BIN
trial1/out/main2
Normal file
Binary file not shown.
1
trial2/include/hellomake.h
Normal file
1
trial2/include/hellomake.h
Normal file
@ -0,0 +1 @@
|
||||
void myPrintHelloMake(void);
|
9
trial2/src/hellofunc.c
Normal file
9
trial2/src/hellofunc.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include <stdio.h>
|
||||
#include <hellomake.h>
|
||||
|
||||
void myPrintHelloMake(void) {
|
||||
|
||||
printf("Hello makefiles!\n");
|
||||
|
||||
return;
|
||||
}
|
BIN
trial2/src/hellomake
Normal file
BIN
trial2/src/hellomake
Normal file
Binary file not shown.
8
trial2/src/hellomake.c
Normal file
8
trial2/src/hellomake.c
Normal file
@ -0,0 +1,8 @@
|
||||
#include <hellomake.h>
|
||||
|
||||
int main() {
|
||||
// call a function in another file
|
||||
myPrintHelloMake();
|
||||
|
||||
return(0);
|
||||
}
|
26
trial2/src/makefile
Normal file
26
trial2/src/makefile
Normal file
@ -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)/*~
|
BIN
trial2/src/obj/hellofunc.o
Normal file
BIN
trial2/src/obj/hellofunc.o
Normal file
Binary file not shown.
BIN
trial2/src/obj/hellomake.o
Normal file
BIN
trial2/src/obj/hellomake.o
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user