Export header functions

This commit is contained in:
Alex 2022-01-21 18:57:10 +00:00
parent 3328c023a9
commit 84aa4d77c6
3 changed files with 24 additions and 10 deletions

View File

@ -1,5 +1,6 @@
#include "export.h"
int crypto_aead_encrypt(
EXPORT int crypto_aead_encrypt(
unsigned char *c, unsigned long long *clen,
const unsigned char *m, unsigned long long mlen,
const unsigned char *ad, unsigned long long adlen,
@ -8,7 +9,7 @@ int crypto_aead_encrypt(
const unsigned char *k
);
int crypto_aead_decrypt(
EXPORT int crypto_aead_decrypt(
unsigned char *m, unsigned long long *mlen,
unsigned char *nsec,
const unsigned char *c, unsigned long long clen,

11
Romulus-M/export.h Normal file
View File

@ -0,0 +1,11 @@
/**
* BUTLERSAURUS 2022 addition
*
* This header defines a cross-platform EXPORT macro in order to allow us to
* build this reference implementation as a library.
*/
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#else
#define EXPORT __attribute__((visibility("default")))
#endif

View File

@ -1,4 +1,6 @@
int romulus_m_encrypt (
#include "export.h"
EXPORT int romulus_m_encrypt (
unsigned char* c, unsigned long long* clen,
const unsigned char* m, unsigned long long mlen,
const unsigned char* ad, unsigned long long adlen,
@ -7,11 +9,11 @@ int romulus_m_encrypt (
const unsigned char* k
);
int romulus_m_decrypt(
unsigned char *m,unsigned long long *mlen,
unsigned char *nsec,
const unsigned char *c,unsigned long long clen,
const unsigned char *ad,unsigned long long adlen,
const unsigned char *npub,
const unsigned char *k
EXPORT int romulus_m_decrypt(
unsigned char *m,unsigned long long *mlen,
unsigned char *nsec,
const unsigned char *c,unsigned long long clen,
const unsigned char *ad,unsigned long long adlen,
const unsigned char *npub,
const unsigned char *k
);