Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
avr-pager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yids
avr-pager
Commits
60db68da
Commit
60db68da
authored
Oct 17, 2016
by
yids
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some avrnacl stuff in pagerlib
parent
57d302f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
libs/pagerlib/pagerlib.c
libs/pagerlib/pagerlib.c
+3
-2
libs/pagerlib/pagerlib.h
libs/pagerlib/pagerlib.h
+3
-1
No files found.
libs/pagerlib/pagerlib.c
View file @
60db68da
...
...
@@ -49,7 +49,7 @@ int rng (uint8_t *dest, unsigned size) {
return
1
;
#else
// arduino rng comes here
memcpy
(
dest
,
&
fakeiv
,
size
);
//
memcpy(dest, &fakeiv, size);
return
0
;
#endif
}
...
...
@@ -119,7 +119,8 @@ inline int pl_send_message(struct pl_ctx *ctx) {
memset
(
temp_plain
,
'\0'
,
crypto_box_ZEROBYTES
);
memcpy
(
temp_plain
+
crypto_box_ZEROBYTES
,
ctx
->
msg
->
msg
,
PLAIN_MSG_SIZE
);
//char nonce[crypto_box_NONCEBYTES];
randombytes
(
ctx
->
msg
->
nonce
,
crypto_box_NONCEBYTES
);
randombytes
(
ctx
->
msg
->
nonce
,
crypto_box_NONCEBYTES
);
rc
=
crypto_box
(
temp_encrypted
,
temp_plain
,
crypto_box_ZEROBYTES
+
PLAIN_MSG_SIZE
,
ctx
->
msg
->
nonce
,
ctx
->
receiver_public_key
,
ctx
->
kp
->
secret_key
);
...
...
libs/pagerlib/pagerlib.h
View file @
60db68da
...
...
@@ -17,7 +17,9 @@ extern "C"
#include "things.h"
#ifdef ARDUINO
#include <AESLib.h>
// #include <AESLib.h>
#include "../avrnacl/avrnacl.h"
#include "../avrnacl/randombytes/randombytes.h"
#else
#include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment