added raw library encryption test with static keys, cipher and message

This commit is contained in:
TLINDEN
2013-11-24 19:59:55 +01:00
parent e2713d40ec
commit ff78754ddd
20 changed files with 297 additions and 242 deletions

20
tests/statictest.c Normal file
View File

@@ -0,0 +1,20 @@
#include <pcp.h>
#include "static.h"
int main() {
unsigned char *t = ucmalloc(12);
if(pcp_sodium_verify_box(&t, cipher, cipher_len, nonce, secret_b, public_a) == 0) {
if(memcmp(t, message, message_len) == 0) {
printf("ok\n");
}
else {
printf("decrypted but message doesnt match\n");
return 1;
}
}
else {
printf("failed to decrypt\n");
return 1;
}
return 0;
}