xref: /dragonfly/lib/libcrypt/local.h (revision 9348a738)
1 /*
2  *
3  */
4 
5 struct sha256_ctx
6 {
7 	uint32_t H[8];
8 
9 	uint32_t total[2];
10 	uint32_t buflen;
11 	char buffer[128]; /* NB: always correctly aligned for uint32_t.  */
12 };
13 
14 struct sha512_ctx
15 {
16 	uint64_t H[8];
17 
18 	uint64_t total[2];
19 	uint64_t buflen;
20 	char buffer[256]; /* NB: always correctly aligned for uint64_t.  */
21 };
22 
23 void __crypt__sha256_process_block (const void *buffer, size_t len,
24 			struct sha256_ctx *ctx);
25 void __crypt__sha256_init_ctx (struct sha256_ctx *ctx);
26 void *__crypt__sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
27 void __crypt__sha256_process_bytes (const void *buffer, size_t len,
28 			struct sha256_ctx *ctx);
29 
30 void __crypt__sha512_process_block (const void *buffer, size_t len,
31 			struct sha512_ctx *ctx);
32 void __crypt__sha512_init_ctx (struct sha512_ctx *ctx);
33 void *__crypt__sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
34 void __crypt__sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx);
35 void __crypt__sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx);
36 void __crypt__sha512_init_ctx (struct sha512_ctx *ctx);
37