Commit 60db68da authored by yids's avatar yids

some avrnacl stuff in pagerlib

parent 57d302f1
......@@ -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);
......
......@@ -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"
......
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