12 /** An SHA-1 digest */
18 /** An SHA-1 data block */
24 /** Final block structure */
33 /** SHA-1 digest and data block
35 * The order of fields within this structure is designed to minimise
38 struct sha1_digest_data
{
39 /** Digest of data already processed */
40 struct sha1_digest digest
;
41 /** Accumulated data */
42 union sha1_block data
;
43 } __attribute__ (( packed
));
45 /** SHA-1 digest and data block */
46 union sha1_digest_data_dwords
{
47 /** Digest and data block */
48 struct sha1_digest_data dd
;
50 uint32_t dword
[ sizeof ( struct sha1_digest_data
) /
51 sizeof ( uint32_t ) ];
54 /** An SHA-1 context */
56 /** Amount of accumulated data */
58 /** Digest and accumulated data */
59 union sha1_digest_data_dwords ddd
;
60 } __attribute__ (( packed
));
62 /** SHA-1 context size */
63 #define SHA1_CTX_SIZE sizeof ( struct sha1_context )
65 /** SHA-1 digest size */
66 #define SHA1_DIGEST_SIZE sizeof ( struct sha1_digest )
68 extern void sha1_init ( void *ctx
);
69 extern void sha1_update ( void *ctx
, const void *data
, size_t len
);
70 extern void sha1_final ( void *ctx
, void *out
);