From 3f1586623cf23ed0e1c1211926eab7cac0bdb13e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 10 May 2020 22:29:25 +0200 Subject: [PATCH] Deprecate non-easy secretbox --- .../include/sodium/crypto_secretbox.h | 9 +++-- .../crypto_secretbox_xsalsa20poly1305.h | 38 ++++++++++--------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/libsodium/include/sodium/crypto_secretbox.h b/src/libsodium/include/sodium/crypto_secretbox.h index 1d3709db..68024b45 100644 --- a/src/libsodium/include/sodium/crypto_secretbox.h +++ b/src/libsodium/include/sodium/crypto_secretbox.h @@ -69,22 +69,23 @@ void crypto_secretbox_keygen(unsigned char k[crypto_secretbox_KEYBYTES]) #define crypto_secretbox_ZEROBYTES crypto_secretbox_xsalsa20poly1305_ZEROBYTES SODIUM_EXPORT -size_t crypto_secretbox_zerobytes(void); +size_t crypto_secretbox_zerobytes(void) __attribute__ ((deprecated)); #define crypto_secretbox_BOXZEROBYTES crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES SODIUM_EXPORT -size_t crypto_secretbox_boxzerobytes(void); +size_t crypto_secretbox_boxzerobytes(void) __attribute__ ((deprecated)); SODIUM_EXPORT int crypto_secretbox(unsigned char *c, const unsigned char *m, unsigned long long mlen, const unsigned char *n, - const unsigned char *k) __attribute__ ((nonnull(1, 4, 5))); + const unsigned char *k) + __attribute__ ((deprecated)) __attribute__ ((nonnull(1, 4, 5))); SODIUM_EXPORT int crypto_secretbox_open(unsigned char *m, const unsigned char *c, unsigned long long clen, const unsigned char *n, const unsigned char *k) - __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); + __attribute__ ((deprecated)) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); #ifdef __cplusplus } diff --git a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h index be0874cb..81bff3d6 100644 --- a/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +++ b/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h @@ -30,22 +30,6 @@ size_t crypto_secretbox_xsalsa20poly1305_macbytes(void); SODIUM_EXPORT size_t crypto_secretbox_xsalsa20poly1305_messagebytes_max(void); -SODIUM_EXPORT -int crypto_secretbox_xsalsa20poly1305(unsigned char *c, - const unsigned char *m, - unsigned long long mlen, - const unsigned char *n, - const unsigned char *k) - __attribute__ ((nonnull(1, 4, 5))); - -SODIUM_EXPORT -int crypto_secretbox_xsalsa20poly1305_open(unsigned char *m, - const unsigned char *c, - unsigned long long clen, - const unsigned char *n, - const unsigned char *k) - __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); - SODIUM_EXPORT void crypto_secretbox_xsalsa20poly1305_keygen(unsigned char k[crypto_secretbox_xsalsa20poly1305_KEYBYTES]) __attribute__ ((nonnull)); @@ -54,13 +38,31 @@ void crypto_secretbox_xsalsa20poly1305_keygen(unsigned char k[crypto_secretbox_x #define crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES 16U SODIUM_EXPORT -size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes(void); +size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes(void) + __attribute__ ((deprecated)); #define crypto_secretbox_xsalsa20poly1305_ZEROBYTES \ (crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES + \ crypto_secretbox_xsalsa20poly1305_MACBYTES) SODIUM_EXPORT -size_t crypto_secretbox_xsalsa20poly1305_zerobytes(void); +size_t crypto_secretbox_xsalsa20poly1305_zerobytes(void) + __attribute__ ((deprecated)); + +SODIUM_EXPORT +int crypto_secretbox_xsalsa20poly1305(unsigned char *c, + const unsigned char *m, + unsigned long long mlen, + const unsigned char *n, + const unsigned char *k) + __attribute__ ((deprecated)) __attribute__ ((nonnull(1, 4, 5))); + +SODIUM_EXPORT +int crypto_secretbox_xsalsa20poly1305_open(unsigned char *m, + const unsigned char *c, + unsigned long long clen, + const unsigned char *n, + const unsigned char *k) + __attribute__ ((deprecated)) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(2, 4, 5))); #ifdef __cplusplus }