Skip to content

Commit

Permalink
lib: Move sha context and result size to new header
Browse files Browse the repository at this point in the history
This is to prepare for SHA3 inclusion
  • Loading branch information
cmouse authored and GitLab committed Nov 8, 2016
1 parent 1007721 commit 6868400
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/lib/Makefile.am
Expand Up @@ -269,6 +269,7 @@ headers = \
safe-mkstemp.h \
sendfile-util.h \
seq-range-array.h \
sha-common.h \
sha1.h \
sha2.h \
sort.h \
Expand Down
9 changes: 9 additions & 0 deletions src/lib/sha-common.h
@@ -0,0 +1,9 @@
#ifndef SHA_COMMON

#define SHA256_RESULTLEN (256 / 8)
#define SHA256_BLOCK_SIZE (512 / 8)

#define SHA512_RESULTLEN (512 / 8)
#define SHA512_BLOCK_SIZE (1024 / 8)

#endif
7 changes: 1 addition & 6 deletions src/lib/sha2.h
Expand Up @@ -35,12 +35,7 @@
#define SHA2_H

#include "hash-method.h"

#define SHA256_RESULTLEN (256 / 8)
#define SHA256_BLOCK_SIZE (512 / 8)

#define SHA512_RESULTLEN (512 / 8)
#define SHA512_BLOCK_SIZE (1024 / 8)
#include "sha-common.h"

struct sha256_ctx {
size_t tot_len;
Expand Down

0 comments on commit 6868400

Please sign in to comment.