Commit 57d302f1 authored by yids's avatar yids


parent d124111e
CFILES=blink.c CFILES=blink.c
LIBCFILES= LIBCFILES=../libs/avrnacl/randombytes/randombytes.c
CFLAGS=-Os -pedantic -std=gnu99 CFLAGS=-Os -pedantic -std=gnu99 -DARDUINO -I../libs/avrnacl/randombytes -I../libs/avrnacl/avrnacl_small/include
MCU=atmega328p MCU=atmega328p
...@@ -9,13 +9,15 @@ F_CPU=F_CPU=16000000UL ...@@ -9,13 +9,15 @@ F_CPU=F_CPU=16000000UL
AVRDUDE_PROGRAMMERID=stk200 /* Programmer ids are listed in /etc/avrdude.conf */ AVRDUDE_PROGRAMMERID=stk200 /* Programmer ids are listed in /etc/avrdude.conf */
all: lib-test
blink: blink.c blink: blink.c
avr-gcc blink.c $(OPTIMZE) -g -I AVRLIB/ -mmcu=$(MCU) -D$(F_CPU) $(CFLAGS) $(LIBCFILES) -o blink.elf avr-gcc blink.c $(OPTIMZE) -g -I AVRLIB/ -mmcu=$(MCU) -D$(F_CPU) $(CFLAGS) $(LIBCFILES) -o blink.elf
avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex
rm blink.elf rm blink.elf
lib-test: lib-test.c lib-test: lib-test.c
avr-gcc lib-test.c $(OPTIMZE) -g -I AVRLIB/ -mmcu=$(MCU) -D$(F_CPU) $(CFLAGS) $(LIBCFILES) -o lib-test.elf avr-gcc lib-test.c ../libs/pagerlib/pagerlib.c ../libs/pagerlib/things.c $(LIBCFILES) $(OPTIMZE) -g -I AVRLIB/ -mmcu=$(MCU) -D$(F_CPU) $(CFLAGS) $(LIBCFILES) -o lib-test.elf
avr-objcopy -j .text -j .data -O ihex lib-test.elf lib-test.hex avr-objcopy -j .text -j .data -O ihex lib-test.elf lib-test.hex
rm lib-test.elf rm lib-test.elf
/* build test for avr, to test if the libs build */
#define ARDUINO
#include <stdio.h>
#include <avr/io.h>
#include <util/delay.h>
//#include "../libs/RadioHead/RadioHead.h"
#include "../libs/avrnacl/avrnacl.h"
//#include "../libs/pagerlib/pagerlib.h"
//#include "../libs/avrnacl/randombytes/randombytes.h"
char tx_priv_key[crypto_box_SECRETKEYBYTES] = {0x23, 0x4D, 0x77, 0xFFFFFFF7, 0x09, 0x70, 0x46, 0xFFFFFF82, 0xFFFFFFC7, 0x0B, 0x70, 0x39, 0xFFFFFFDA, 0x24, 0x4A, 0xFFFFFF9C, 0x28, 0x7A, 0xFFFFFFD8, 0xFFFFFFCE, 0x7B, 0xFFFFFFEF, 0xFFFFFFFB, 0x75, 0x7E, 0x34, 0x16, 0xFFFFFF99, 0xFFFFFFF6, 0x60, 0x08, 0x0A };
char tx_comp_p[crypto_box_PUBLICKEYBYTES] = {0xFFFFFFC1, 0xFFFFFFEF, 0xFFFFFF89, 0xFFFFFFA8, 0x66, 0x44, 0xFFFFFFD6, 0x72, 0x26, 0xFFFFFF84, 0xFFFFFFA9, 0xFFFFFFF5, 0xFFFFFF9A, 0xFFFFFFFC, 0xFFFFFF88, 0x38, 0xFFFFFFA3, 0x1D, 0x71, 0x05, 0xFFFFFFB9, 0x0A, 0x0F, 0xFFFFFFF3, 0xFFFFFF93, 0xFFFFFFEF, 0x48, 0xFFFFFFA1, 0xFFFFFFB7, 0x49, 0xFFFFFF90, 0x6D};
char rx_priv_key[crypto_box_SECRETKEYBYTES] = {0xFFFFFF84, 0x70, 0x10, 0x49, 0x01, 0xFFFFFFC3, 0x4F, 0xFFFFFFA2, 0x2A, 0x2A, 0xFFFFFFB9, 0x19, 0xFFFFFF8D, 0x1E, 0x44, 0x46, 0x26, 0x15, 0x3B, 0xFFFFFF92, 0x00, 0xFFFFFF91, 0x6A, 0x41, 0x36, 0xFFFFFFDF, 0x7E, 0xFFFFFF97, 0x6D, 0x3C, 0x6E, 0x01 };
char rx_comp_p[crypto_box_PUBLICKEYBYTES] = {0xFFFFFFA9, 0xFFFFFFB4, 0xFFFFFFA1, 0xFFFFFFF3, 0x56, 0x27, 0x70, 0xFFFFFF9E, 0xFFFFFFBD, 0x32, 0x27, 0x0A, 0xFFFFFFB8, 0x06, 0xFFFFFFE7, 0xFFFFFFE8, 0xFFFFFF98, 0xFFFFFFA4, 0x11, 0xFFFFFFD8, 0xFFFFFFB5, 0x64, 0xFFFFFF84, 0x64, 0xFFFFFFB6, 0xFFFFFFB6, 0x48, 0xFFFFFFEC, 0x0C, 0xFFFFFFA4, 0x1F, 0x49};
struct pl_keypair *sender, *receiver;
char clear_message[] = "dit is een test berichtje :) ";
struct pl_ctx * context;
int main(void)
context = pl_init();
// sender = (struct pl_keypair *) malloc(sizeof(struct pl_keypair));
// receiver = (struct pl_keypair *) malloc(sizeof(struct pl_keypair));
return 0;
Markdown is supported
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