Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/sodium/crypto_auth_hmacsha512.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_hmacsha512_H
0002 #define crypto_auth_hmacsha512_H
0003 
0004 #include <stddef.h>
0005 #include "crypto_hash_sha512.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_hmacsha512_BYTES 64U
0016 SODIUM_EXPORT
0017 size_t crypto_auth_hmacsha512_bytes(void);
0018 
0019 #define crypto_auth_hmacsha512_KEYBYTES 32U
0020 SODIUM_EXPORT
0021 size_t crypto_auth_hmacsha512_keybytes(void);
0022 
0023 SODIUM_EXPORT
0024 int crypto_auth_hmacsha512(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_hmacsha512_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_hmacsha512_state {
0039     crypto_hash_sha512_state ictx;
0040     crypto_hash_sha512_state octx;
0041 } crypto_auth_hmacsha512_state;
0042 
0043 SODIUM_EXPORT
0044 size_t crypto_auth_hmacsha512_statebytes(void);
0045 
0046 SODIUM_EXPORT
0047 int crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state,
0048                                 const unsigned char *key,
0049                                 size_t keylen) __attribute__ ((nonnull));
0050 
0051 SODIUM_EXPORT
0052 int crypto_auth_hmacsha512_update(crypto_auth_hmacsha512_state *state,
0053                                   const unsigned char *in,
0054                                   unsigned long long inlen) __attribute__ ((nonnull(1)));
0055 
0056 SODIUM_EXPORT
0057 int crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state,
0058                                  unsigned char *out) __attribute__ ((nonnull));
0059 
0060 SODIUM_EXPORT
0061 void crypto_auth_hmacsha512_keygen(unsigned char k[crypto_auth_hmacsha512_KEYBYTES])
0062             __attribute__ ((nonnull));
0063 
0064 #ifdef __cplusplus
0065 }
0066 #endif
0067 
0068 #endif