diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-03-27 13:28:03 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-03-27 13:28:03 +0000 |
commit | e17f71f9f01a429664caf120d9ac159ed9f5283f (patch) | |
tree | 524ebfc55d4aa56b2842a109ffffab2319afa6c2 /src/include | |
parent | 36333f75234a6cb1b98cbe104aee3506d6bec9a1 (diff) | |
download | skalibs-e17f71f9f01a429664caf120d9ac159ed9f5283f.tar.xz |
- added sha512 (buggy, need to commit to test somewhere else)
- version bump (not a rc yet)
- bugfix: buffer_get returned -1 EPIPE on short reads w/o EOF
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/skalibs/sha512.h | 21 | ||||
-rw-r--r-- | src/include/skalibs/stdcrypto.h | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/include/skalibs/sha512.h b/src/include/skalibs/sha512.h new file mode 100644 index 0000000..eddb4ed --- /dev/null +++ b/src/include/skalibs/sha512.h @@ -0,0 +1,21 @@ +/* ISC license. */ + +#ifndef SHA512_H +#define SHA512_H + +#include <skalibs/uint64.h> + +typedef struct SHA512Schedule_s SHA512Schedule, *SHA512Schedule_ref ; +struct SHA512Schedule_s +{ + uint64 len ; + uint64 h[8] ; + unsigned char buf[128] ; +} ; + +#define SHA512_INIT() { .len = 0, .h = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL } } +extern void sha512_init (SHA512Schedule *) ; +extern void sha512_update (SHA512Schedule *, char const *, unsigned int) ; +extern void sha512_final (SHA512Schedule *, char *digest) ; + +#endif diff --git a/src/include/skalibs/stdcrypto.h b/src/include/skalibs/stdcrypto.h index bd6751b..dd40d0d 100644 --- a/src/include/skalibs/stdcrypto.h +++ b/src/include/skalibs/stdcrypto.h @@ -7,5 +7,6 @@ #include <skalibs/md5.h> #include <skalibs/sha1.h> #include <skalibs/sha256.h> +#include <skalibs/sha512.h> #endif |