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