/* * An implementation of the SHA-256 hash function, this is endian neutral * so should work just about anywhere. * * Revised Code: Complies to SHA-256 standard now. * * Tom St Denis -- http://tomstdenis.home.dhs.org */ #ifndef _SHA256_ #define _SHA256_ #include "uint.h" #define SHA256_DIGEST_SIZE 32 struct sha256_ctx{ unsigned long state[8], length, curlen; unsigned char buf[64]; }; void sha256_init(void *ctx); void sha256_update(void *ctx, const u8 *data, unsigned int len); void sha256_final(void *ctx, u8 *out); #endif