Warning, file /include/sodium/crypto_kdf_hkdf_sha256.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_kdf_hkdf_sha256_H
0002 #define crypto_kdf_hkdf_sha256_H
0003
0004 #include <stddef.h>
0005 #include <stdint.h>
0006 #include <stdlib.h>
0007
0008 #include "crypto_kdf.h"
0009 #include "crypto_auth_hmacsha256.h"
0010 #include "export.h"
0011
0012 #ifdef __cplusplus
0013 # ifdef __GNUC__
0014 # pragma GCC diagnostic ignored "-Wlong-long"
0015 # endif
0016 extern "C" {
0017 #endif
0018
0019 #define crypto_kdf_hkdf_sha256_KEYBYTES crypto_auth_hmacsha256_BYTES
0020 SODIUM_EXPORT
0021 size_t crypto_kdf_hkdf_sha256_keybytes(void);
0022
0023 #define crypto_kdf_hkdf_sha256_BYTES_MIN 0U
0024 SODIUM_EXPORT
0025 size_t crypto_kdf_hkdf_sha256_bytes_min(void);
0026
0027 #define crypto_kdf_hkdf_sha256_BYTES_MAX (0xff * crypto_auth_hmacsha256_BYTES)
0028 SODIUM_EXPORT
0029 size_t crypto_kdf_hkdf_sha256_bytes_max(void);
0030
0031 SODIUM_EXPORT
0032 int crypto_kdf_hkdf_sha256_extract(unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES],
0033 const unsigned char *salt, size_t salt_len,
0034 const unsigned char *ikm, size_t ikm_len)
0035 __attribute__ ((nonnull(4)));
0036
0037 SODIUM_EXPORT
0038 void crypto_kdf_hkdf_sha256_keygen(unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]);
0039
0040 SODIUM_EXPORT
0041 int crypto_kdf_hkdf_sha256_expand(unsigned char *out, size_t out_len,
0042 const char *ctx, size_t ctx_len,
0043 const unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES])
0044 __attribute__ ((nonnull(1)));
0045
0046
0047
0048 typedef struct crypto_kdf_hkdf_sha256_state {
0049 crypto_auth_hmacsha256_state st;
0050 } crypto_kdf_hkdf_sha256_state;
0051
0052 SODIUM_EXPORT
0053 size_t crypto_kdf_hkdf_sha256_statebytes(void);
0054
0055 SODIUM_EXPORT
0056 int crypto_kdf_hkdf_sha256_extract_init(crypto_kdf_hkdf_sha256_state *state,
0057 const unsigned char *salt, size_t salt_len)
0058 __attribute__ ((nonnull(1)));
0059
0060 SODIUM_EXPORT
0061 int crypto_kdf_hkdf_sha256_extract_update(crypto_kdf_hkdf_sha256_state *state,
0062 const unsigned char *ikm, size_t ikm_len)
0063 __attribute__ ((nonnull));
0064
0065 SODIUM_EXPORT
0066 int crypto_kdf_hkdf_sha256_extract_final(crypto_kdf_hkdf_sha256_state *state,
0067 unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES])
0068 __attribute__ ((nonnull));
0069
0070 #ifdef __cplusplus
0071 }
0072 #endif
0073
0074 #endif