MCPcopy Create free account
hub / github.com/diasurgical/devilution / SHA1CircularShift

Function SHA1CircularShift

Source/sha.cpp:15–24  ·  view source on GitHub ↗

* Diablo-"SHA1" circular left shift, portable version. */

Source from the content-addressed store, hash-verified

13 * Diablo-"SHA1" circular left shift, portable version.
14 */
15std::uint32_t SHA1CircularShift(std::uint32_t bits, std::uint32_t word) {
16 assert(bits < 32);
17 assert(bits > 0);
18
19 if(word >> 31) {
20 return (word << bits) | (~((~word) >> (32 - bits)));
21 } else {
22 return (word << bits) | (word >> (32 - bits));
23 }
24}
25
26} // namespace
27

Callers 1

SHA1ProcessMessageBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected