54#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
55#define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y))))
56#define H(x, y, z) ((x) ^ (y) ^ (z))
57#define I(x, y, z) ((y) ^ ((x) | ~(z)))
60#define STEP(f, a, b, c, d, x, t, s) \
61 (a) += f((b), (c), (d)) + (x) + (t); \
62 (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \
68 (InternalState.block[(n)] = (MD5_u32plus)ptr[(n)*4] | \
69 ((MD5_u32plus)ptr[(n)*4 + 1] << 8) | \
70 ((MD5_u32plus)ptr[(n)*4 + 2] << 16) | \
71 ((MD5_u32plus)ptr[(n)*4 + 3] << 24))
72#define GET(n) (InternalState.block[(n)])
80 MD5_u32plus
a,
b,
c,
d;
81 MD5_u32plus saved_a, saved_b, saved_c, saved_d;
175 }
while (
Size -= 64);
189 MD5_u32plus saved_lo;
190 unsigned long used, free;
194 saved_lo = InternalState.lo;
195 if ((InternalState.lo = (saved_lo +
Size) & 0x1fffffff) < saved_lo)
197 InternalState.hi +=
Size >> 29;
199 used = saved_lo & 0x3f;
205 memcpy(&InternalState.buffer[used],
Ptr,
Size);
209 memcpy(&InternalState.buffer[used],
Ptr, free);
212 body(
ArrayRef(InternalState.buffer, 64));
220 memcpy(InternalState.buffer,
Ptr,
Size);
234 unsigned long used, free;
236 used = InternalState.lo & 0x3f;
238 InternalState.buffer[used++] = 0x80;
243 memset(&InternalState.buffer[used], 0, free);
244 body(
ArrayRef(InternalState.buffer, 64));
249 memset(&InternalState.buffer[used], 0, free - 8);
251 InternalState.lo <<= 3;
255 body(
ArrayRef(InternalState.buffer, 64));
270 auto StateToRestore = InternalState;
275 InternalState = StateToRestore;
282 toHex(*
this,
true, Str);
287 toHex(Result,
true, Str);
#define STEP(f, a, b, c, d, x, t, s)
#define SET(ID, TYPE, VAL)
This file defines the SmallString class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
LLVM_ABI void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
static LLVM_ABI void stringifyResult(MD5Result &Result, SmallVectorImpl< char > &Str)
Translates the bytes in Res to a hex string that is deposited into Str.
LLVM_ABI void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
LLVM_ABI MD5Result final()
Finishes off the hash, and returns the 16-byte hash data.
LLVM_ABI MD5Result result()
Finishes off the hash, and returns the 16-byte hash data.
static LLVM_ABI MD5Result hash(ArrayRef< uint8_t > Data)
Computes the hash for a given bytes.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
void write32le(void *P, uint32_t V)
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
ArrayRef(const T &OneElt) -> ArrayRef< T >
void toHex(ArrayRef< uint8_t > Input, bool LowerCase, SmallVectorImpl< char > &Output)
Convert buffer Input to its hexadecimal representation. The returned string is double the size of Inp...
LLVM_ABI SmallString< 32 > digest() const