2018-04-24 12:33:55 -04:00
|
|
|
#include <openssl/sha.h>
|
|
|
|
#include "../include/sha512.h"
|
|
|
|
|
2019-04-07 10:58:14 -04:00
|
|
|
|
2019-04-07 10:06:22 -04:00
|
|
|
int _ed_sha512_init(sha512_context * md) {
|
2018-04-24 12:33:55 -04:00
|
|
|
return SHA512_Init(md) != 1; /* Returns 0 on success */
|
|
|
|
}
|
|
|
|
|
2019-04-07 10:06:22 -04:00
|
|
|
int _ed_sha512_final(sha512_context * md, unsigned char *out) {
|
2018-04-24 12:33:55 -04:00
|
|
|
return SHA512_Final(out, md) != 1; /* Returns 0 on success */
|
|
|
|
}
|
|
|
|
|
2019-04-07 10:06:22 -04:00
|
|
|
int _ed_sha512_update(sha512_context * md, const unsigned char *in, size_t inlen) {
|
2018-04-24 12:33:55 -04:00
|
|
|
return SHA512_Update(md, in, inlen) != 1; /* Returns 0 on success */
|
|
|
|
}
|
|
|
|
|
2019-04-07 10:58:14 -04:00
|
|
|
extern sha512_functions _ed_sha512_functions = {
|
|
|
|
_ed_sha512_init,
|
|
|
|
_ed_sha512_final,
|
|
|
|
_ed_sha512_update
|
|
|
|
};
|