mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
+ crypto_generichash_statebytes()
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user