sha256.h (841B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef _SHA_256_H_ 6 #define _SHA_256_H_ 7 8 #include "prtypes.h" 9 10 struct SHA256ContextStr; 11 12 typedef void (*sha256_compress_t)(struct SHA256ContextStr *); 13 typedef void (*sha256_update_t)(struct SHA256ContextStr *, const unsigned char *, 14 unsigned int); 15 16 struct SHA256ContextStr { 17 union { 18 PRUint32 w[64]; /* message schedule, input buffer, plus 48 words */ 19 PRUint8 b[256]; 20 } u; 21 PRUint32 h[8]; /* 8 state variables */ 22 PRUint32 sizeHi, sizeLo; /* 64-bit count of hashed bytes. */ 23 sha256_compress_t compress; 24 sha256_update_t update; 25 }; 26 27 #endif /* _SHA_256_H_ */