This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sodium/crypto_box.h> | |
#include <sodium/randombytes.h> | |
int main(int argc, char *argv[]) { | |
// payload | |
unsigned char payload[] = "Hello world, this is a test payload to test NaCl's cipher."; | |
unsigned char payload_padded[crypto_box_ZEROBYTES + sizeof(payload)] = {0}; | |
for (int i = 0; i < sizeof(payload); i++) |