+ crypto_generichash_statebytes()

This commit is contained in:
Frank Denis
2015-01-23 11:00:57 +01:00
parent c9ba75a48f
commit 9e538624f4
3 changed files with 15 additions and 6 deletions
@@ -1,6 +1,12 @@
#include "crypto_onetimeauth.h"
size_t
crypto_onetimeauth_statebytes(void)
{
return sizeof(crypto_onetimeauth_state);
}
size_t
crypto_onetimeauth_bytes(void)
{
@@ -13,12 +19,6 @@ crypto_onetimeauth_keybytes(void)
return crypto_onetimeauth_KEYBYTES;
}
const char *
crypto_onetimeauth_primitive(void)
{
return crypto_onetimeauth_PRIMITIVE;
}
int
crypto_onetimeauth(unsigned char *out, const unsigned char *in,
unsigned long long inlen, const unsigned char *k)
@@ -57,3 +57,9 @@ crypto_onetimeauth_final(crypto_onetimeauth_state *state,
return crypto_onetimeauth_poly1305_final
((crypto_onetimeauth_poly1305_state *) state, out);
}
const char *
crypto_onetimeauth_primitive(void)
{
return crypto_onetimeauth_PRIMITIVE;
}
@@ -14,6 +14,8 @@ extern "C" {
#endif
typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state;
SODIUM_EXPORT
size_t crypto_onetimeauth_statebytes(void);
#define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES
SODIUM_EXPORT
+1
View File
@@ -27,6 +27,7 @@ int main(void)
crypto_onetimeauth_state st;
int i;
assert(crypto_onetimeauth_statebytes() == sizeof st);
crypto_onetimeauth(a, c, 131, rs);
for (i = 0; i < 16; ++i) {
printf(",0x%02x", (unsigned int)a[i]);