Converts a given 'midstate' value to a 'hash' value as 32 bytes stored in an unsigned char array. * * Precondition: unsigned char hash[32]; * uint32_t midstate[8] */
| 81 | * uint32_t midstate[8] |
| 82 | */ |
| 83 | static inline void sha256_fromMidstate(unsigned char* hash, const uint32_t* midstate) { |
| 84 | WriteBE32(hash + 0*4, midstate[0]); |
| 85 | WriteBE32(hash + 1*4, midstate[1]); |
| 86 | WriteBE32(hash + 2*4, midstate[2]); |
| 87 | WriteBE32(hash + 3*4, midstate[3]); |
| 88 | WriteBE32(hash + 4*4, midstate[4]); |
| 89 | WriteBE32(hash + 5*4, midstate[5]); |
| 90 | WriteBE32(hash + 6*4, midstate[6]); |
| 91 | WriteBE32(hash + 7*4, midstate[7]); |
| 92 | } |
| 93 | |
| 94 | /* Converts a given 'hash' value as 32 bytes stored in an unsigned char array to a 'midstate' value. |
| 95 | * |