/* SHA-512 code by Jean-Luc Cooke * * Copyright (c) Jean-Luc Cooke * Copyright (c) Andrew McDonald * Copyright (c) 2003 Kyle McMartin * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * */ #ifndef _SHA512_ #define _SHA512_ #include "uint.h" #define SHA384_DIGEST_SIZE 48 #define SHA512_DIGEST_SIZE 64 #define SHA384_HMAC_BLOCK_SIZE 96 #define SHA512_HMAC_BLOCK_SIZE 128 struct sha512_ctx { u64 state[8]; u32 count[4]; u8 buf[128]; }; void sha512_init(void *ctx); void sha384_init(void *ctx); void sha512_update(void *ctx, const u8 *data, unsigned int len); void sha512_final(void *ctx, u8 *hash); void sha384_final(void *ctx, u8 *hash); #endif