Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:11

0001 #ifndef crypto_kem_H
0002 #define crypto_kem_H
0003 
0004 /*
0005  * THREAD SAFETY: crypto_kem_keypair() is thread-safe,
0006  * provided that sodium_init() was called before.
0007  *
0008  * Other functions are always thread-safe.
0009  */
0010 
0011 #include <stddef.h>
0012 
0013 #include "crypto_kem_xwing.h"
0014 #include "export.h"
0015 
0016 #ifdef __cplusplus
0017 # ifdef __GNUC__
0018 #  pragma GCC diagnostic ignored "-Wlong-long"
0019 # endif
0020 extern "C" {
0021 #endif
0022 
0023 #define crypto_kem_PUBLICKEYBYTES crypto_kem_xwing_PUBLICKEYBYTES
0024 SODIUM_EXPORT
0025 size_t crypto_kem_publickeybytes(void);
0026 
0027 #define crypto_kem_SECRETKEYBYTES crypto_kem_xwing_SECRETKEYBYTES
0028 SODIUM_EXPORT
0029 size_t crypto_kem_secretkeybytes(void);
0030 
0031 #define crypto_kem_CIPHERTEXTBYTES crypto_kem_xwing_CIPHERTEXTBYTES
0032 SODIUM_EXPORT
0033 size_t crypto_kem_ciphertextbytes(void);
0034 
0035 #define crypto_kem_SHAREDSECRETBYTES crypto_kem_xwing_SHAREDSECRETBYTES
0036 SODIUM_EXPORT
0037 size_t crypto_kem_sharedsecretbytes(void);
0038 
0039 #define crypto_kem_SEEDBYTES crypto_kem_xwing_SEEDBYTES
0040 SODIUM_EXPORT
0041 size_t crypto_kem_seedbytes(void);
0042 
0043 #define crypto_kem_PRIMITIVE "xwing"
0044 SODIUM_EXPORT
0045 const char *crypto_kem_primitive(void);
0046 
0047 SODIUM_EXPORT
0048 int crypto_kem_seed_keypair(unsigned char *pk, unsigned char *sk,
0049                             const unsigned char *seed)
0050             __attribute__ ((nonnull));
0051 
0052 SODIUM_EXPORT
0053 int crypto_kem_keypair(unsigned char *pk, unsigned char *sk)
0054             __attribute__ ((nonnull));
0055 
0056 SODIUM_EXPORT
0057 int crypto_kem_enc(unsigned char *ct, unsigned char *ss,
0058                    const unsigned char *pk)
0059             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0060 
0061 SODIUM_EXPORT
0062 int crypto_kem_dec(unsigned char *ss, const unsigned char *ct,
0063                    const unsigned char *sk)
0064             __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0065 
0066 #ifdef __cplusplus
0067 }
0068 #endif
0069 
0070 #endif