Files
scst/iscsi-scst/usr/sha1.h
Vladislav Bolkhovitin c1a13ebaf4 Forgotten new files for r1651
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1652 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-23 17:50:01 +00:00

29 lines
594 B
C

/*
* Common values for SHA algorithms
*/
#ifndef SHA1_H
#define SHA1_H
#include "types.h"
#include <string.h>
#define SHA1_DIGEST_WORDS 5
#define SHA1_DIGEST_BYTES (SHA1_DIGEST_WORDS * 4)
#define SHA1_BLOCK_WORDS 16
#define SHA1_BLOCK_BYTES (SHA1_BLOCK_WORDS * 4)
#define SHA1_WORKSPACE_WORDS 80
#define SHA1_COUNTER_BYTES 8
struct sha1_ctx {
u32 digest[SHA1_DIGEST_WORDS];
u32 block[SHA1_BLOCK_WORDS];
u64 count;
};
void sha1_init(struct sha1_ctx *ctx);
void sha1_update(struct sha1_ctx *ctx, const void *data_in, size_t len);
void sha1_final(struct sha1_ctx *ctx, u8 *out);
#endif