Skip to content

Commit

Permalink
Add lookup methods for crypto_auth_hmacsha256 constants
Browse files Browse the repository at this point in the history
  • Loading branch information
stouset committed May 15, 2013
1 parent 6988a02 commit 8a6daf0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libsodium/Makefile.am
Expand Up @@ -4,6 +4,7 @@ lib_LTLIBRARIES = \

libsodium_la_SOURCES = \
crypto_auth/crypto_auth.c \
crypto_auth/hmacsha256/auth_hmacsha256.c \
crypto_auth/hmacsha256/ref/api.h \
crypto_auth/hmacsha256/ref/hmac_hmacsha256.c \
crypto_auth/hmacsha256/ref/verify_hmacsha256.c \
Expand Down
17 changes: 17 additions & 0 deletions src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256.c
@@ -0,0 +1,17 @@
#include <stdlib.h>
#include "crypto_auth_hmacsha256.h"

size_t
crypto_auth_hmacsha256_bytes(void) {
return crypto_auth_hmacsha256_BYTES;
}

size_t
crypto_auth_hmacsha256_keybytes(void) {
return crypto_auth_hmacsha256_BYTES;
}

const char *
crypto_auth_hmacsha256_primitive(void) {
return "hmacsha256";
}
11 changes: 11 additions & 0 deletions src/libsodium/include/sodium/crypto_auth_hmacsha256.h
@@ -1,6 +1,8 @@
#ifndef crypto_auth_hmacsha256_H
#define crypto_auth_hmacsha256_H

#include <stdlib.h>

#include "export.h"

#define crypto_auth_hmacsha256_BYTES 32U
Expand All @@ -10,6 +12,15 @@
extern "C" {
#endif

SODIUM_EXPORT
size_t crypto_auth_hmacsha256_bytes(void);

SODIUM_EXPORT
size_t crypto_auth_hmacsha256_keybytes(void);

SODIUM_EXPORT
const char *crypto_auth_hmacsha256_primitive(void);

SODIUM_EXPORT
int crypto_auth_hmacsha256(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *);

Expand Down

0 comments on commit 8a6daf0

Please sign in to comment.