Warning, file /include/sodium/crypto_auth_hmacsha256.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 #ifndef crypto_auth_hmacsha256_H
0002 #define crypto_auth_hmacsha256_H
0003
0004 #include <stddef.h>
0005 #include "crypto_hash_sha256.h"
0006 #include "export.h"
0007
0008 #ifdef __cplusplus
0009 # ifdef __GNUC__
0010 # pragma GCC diagnostic ignored "-Wlong-long"
0011 # endif
0012 extern "C" {
0013 #endif
0014
0015 #define crypto_auth_hmacsha256_BYTES 32U
0016 SODIUM_EXPORT
0017 size_t crypto_auth_hmacsha256_bytes(void);
0018
0019 #define crypto_auth_hmacsha256_KEYBYTES 32U
0020 SODIUM_EXPORT
0021 size_t crypto_auth_hmacsha256_keybytes(void);
0022
0023 SODIUM_EXPORT
0024 int crypto_auth_hmacsha256(unsigned char *out,
0025 const unsigned char *in,
0026 unsigned long long inlen,
0027 const unsigned char *k) __attribute__ ((nonnull(1, 4)));
0028
0029 SODIUM_EXPORT
0030 int crypto_auth_hmacsha256_verify(const unsigned char *h,
0031 const unsigned char *in,
0032 unsigned long long inlen,
0033 const unsigned char *k)
0034 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
0035
0036
0037
0038 typedef struct crypto_auth_hmacsha256_state {
0039 crypto_hash_sha256_state ictx;
0040 crypto_hash_sha256_state octx;
0041 } crypto_auth_hmacsha256_state;
0042
0043 SODIUM_EXPORT
0044 size_t crypto_auth_hmacsha256_statebytes(void);
0045
0046 SODIUM_EXPORT
0047 int crypto_auth_hmacsha256_init(crypto_auth_hmacsha256_state *state,
0048 const unsigned char *key,
0049 size_t keylen) __attribute__ ((nonnull));
0050
0051 SODIUM_EXPORT
0052 int crypto_auth_hmacsha256_update(crypto_auth_hmacsha256_state *state,
0053 const unsigned char *in,
0054 unsigned long long inlen)
0055 __attribute__ ((nonnull(1)));
0056
0057 SODIUM_EXPORT
0058 int crypto_auth_hmacsha256_final(crypto_auth_hmacsha256_state *state,
0059 unsigned char *out) __attribute__ ((nonnull));
0060
0061
0062 SODIUM_EXPORT
0063 void crypto_auth_hmacsha256_keygen(unsigned char k[crypto_auth_hmacsha256_KEYBYTES])
0064 __attribute__ ((nonnull));
0065
0066 #ifdef __cplusplus
0067 }
0068 #endif
0069
0070 #endif