Skip to content

Commit

Permalink
frontend version to be deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrs committed Dec 7, 2016
1 parent ae4f7f5 commit 9473c01
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,5 @@ target/
.clang_complete

.idea

featherm0-frontend/src/keys.h
11 changes: 7 additions & 4 deletions featherm0-frontend/src/config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#define DEBUG true
#include "keys.h"

#define DEBUG false

#define SERIAL_BAUD 115200

Expand All @@ -12,6 +14,7 @@
#define BACKEND_NODEID 42

#define ENCRYPTKEY "1234567890123456" //exactly the same 16 characters/bytes on all nodes!
static char K0[] = { 0xde, 0xca, 0xfb, 0xad, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xff, 0xee, 0xba, 0xbe, 0x42, 0x13, 0x37};
static char K1[] = { 0xbe, 0x42, 0x13, 0x37, 0xde, 0xca, 0xfb, 0xad, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xff, 0xee, 0xba };
static char K2[] = { 0xca, 0xff, 0xee, 0xba, 0xbe, 0x42, 0x13, 0x37, 0xde, 0xca, 0xfb, 0xad, 0xde, 0xad, 0xbe, 0xef };

// static char K0[] = { 0xde, 0xca, 0xfb, 0xad, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xff, 0xee, 0xba, 0xbe, 0x42, 0x13, 0x37};
// static char K1[] = { 0xbe, 0x42, 0x13, 0x37, 0xde, 0xca, 0xfb, 0xad, 0xde, 0xad, 0xbe, 0xef, 0xca, 0xff, 0xee, 0xba };
// static char K2[] = { 0xca, 0xff, 0xee, 0xba, 0xbe, 0x42, 0x13, 0x37, 0xde, 0xca, 0xfb, 0xad, 0xde, 0xad, 0xbe, 0xef };
9 changes: 5 additions & 4 deletions keysets/gen_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import random,json

keynames = ["k0","k1","k2","kh0","kh1"]
keynames = ["K0","K1","K2"]
keys = {}

for key in keynames:
keys[key] = ""
keys[key] = []
for i in range(0,16):
keys[key] += "{:02x}".format(random.randint(0,255))
keys[key].append("0x" + "{:02x}".format(random.randint(0,255)))
print "static char %s[] = { %s };" % (key, ",".join(keys[key]))

print json.dumps(keys)
#print json.dumps(keys)

0 comments on commit 9473c01

Please sign in to comment.