Move crypto_hash_sha256_state to the crypto_hash_sha256.h header file
This commit is contained in:
parent
6c42962b57
commit
9fa62b38a4
@ -38,12 +38,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct crypto_hash_sha256_state {
|
||||
uint32_t state[8];
|
||||
uint32_t count[2];
|
||||
unsigned char buf[64];
|
||||
} crypto_hash_sha256_state;
|
||||
|
||||
typedef struct crypto_hmac_sha256_state {
|
||||
crypto_hash_sha256_state ictx;
|
||||
crypto_hash_sha256_state octx;
|
||||
|
@ -37,12 +37,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct crypto_hash_sha256_state {
|
||||
uint32_t state[8];
|
||||
uint32_t count[2];
|
||||
unsigned char buf[64];
|
||||
} crypto_hash_sha256_state;
|
||||
|
||||
void _SHA256_Init(crypto_hash_sha256_state *);
|
||||
void _SHA256_Update(crypto_hash_sha256_state *, const void *, size_t);
|
||||
void _SHA256_Final(unsigned char [32], crypto_hash_sha256_state *);
|
||||
|
@ -33,20 +33,17 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct SHA256Context {
|
||||
uint32_t state[8];
|
||||
uint32_t count[2];
|
||||
unsigned char buf[64];
|
||||
} SHA256_CTX;
|
||||
#include "crypto_hash_sha256.h"
|
||||
|
||||
typedef struct HMAC_SHA256Context {
|
||||
SHA256_CTX ictx;
|
||||
SHA256_CTX octx;
|
||||
crypto_hash_sha256_state ictx;
|
||||
crypto_hash_sha256_state octx;
|
||||
} HMAC_SHA256_CTX;
|
||||
|
||||
void _SHA256_Init(SHA256_CTX *);
|
||||
void _SHA256_Update(SHA256_CTX *, const void *, size_t);
|
||||
void _SHA256_Final(unsigned char [32], SHA256_CTX *);
|
||||
void _SHA256_Init(crypto_hash_sha256_state *);
|
||||
void _SHA256_Update(crypto_hash_sha256_state *, const void *, size_t);
|
||||
void _SHA256_Final(unsigned char [32], crypto_hash_sha256_state *);
|
||||
|
||||
void HMAC__SHA256_Init(HMAC_SHA256_CTX *, const void *, size_t);
|
||||
void HMAC__SHA256_Update(HMAC_SHA256_CTX *, const void *, size_t);
|
||||
void HMAC__SHA256_Final(unsigned char [32], HMAC_SHA256_CTX *);
|
||||
|
@ -2,6 +2,9 @@
|
||||
#define crypto_hash_sha256_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_hash_sha256_BYTES 32U
|
||||
@ -14,6 +17,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct crypto_hash_sha256_state {
|
||||
uint32_t state[8];
|
||||
uint32_t count[2];
|
||||
unsigned char buf[64];
|
||||
} crypto_hash_sha256_state;
|
||||
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_sha256_bytes(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user