43 const uint8_t* input =
reinterpret_cast<const uint8_t*
>(buf);
44 unsigned int bufferIndex = (
unsigned int)(this->byteCount & 0x3F);
45 unsigned int bufferAvailable = 64 - bufferIndex;
47 unsigned int inputIndex;
48 if (inputLength >= bufferAvailable) {
52 inputIndex = bufferAvailable;
57 for (; inputIndex + 63 < inputLength; inputIndex += 64) {
58 transform(this->state, &input[inputIndex]);
66 sk_careful_memcpy(&this->buffer[bufferIndex], &input[inputIndex], inputLength - inputIndex);
68 this->byteCount += inputLength;
76 encode(bits, this->byteCount << 3);
79 unsigned int bufferIndex = (
unsigned int)(this->byteCount & 0x3F);
80 unsigned int paddingLength = (bufferIndex < 56) ? (56 - bufferIndex) : (120 - bufferIndex);
81 static const uint8_t PADDING[64] = {
82 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
83 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
84 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
85 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
87 (void)this->
write(PADDING, paddingLength);
90 (void)this->
write(bits, 8);
95#if defined(SK_MD5_CLEAR_DATA)
97 memset(
this, 0,
sizeof(*
this));
240static void encode(uint8_t output[16],
const uint32_t input[4]) {
241 for (
size_t i = 0, j = 0; i < 4; i++, j += 4) {
242 output[j ] = (uint8_t) (input[i] & 0xff);
243 output[j+1] = (uint8_t)((input[i] >> 8) & 0xff);
244 output[j+2] = (uint8_t)((input[i] >> 16) & 0xff);
245 output[j+3] = (uint8_t)((input[i] >> 24) & 0xff);
249static void encode(uint8_t output[8],
const uint64_t input) {
250 output[0] = (uint8_t) (input & 0xff);
251 output[1] = (uint8_t)((input >> 8) & 0xff);
252 output[2] = (uint8_t)((input >> 16) & 0xff);
253 output[3] = (uint8_t)((input >> 24) & 0xff);
254 output[4] = (uint8_t)((input >> 32) & 0xff);
255 output[5] = (uint8_t)((input >> 40) & 0xff);
256 output[6] = (uint8_t)((input >> 48) & 0xff);
257 output[7] = (uint8_t)((input >> 56) & 0xff);
264static const uint32_t*
decode(uint32_t storage[16],
const uint8_t input[64]) {
265#if defined(SK_CPU_LENDIAN) && defined(SK_CPU_FAST_UNALIGNED_ACCESS)
266 return reinterpret_cast<const uint32_t*
>(input);
268#if defined(SK_CPU_LENDIAN)
270 return reinterpret_cast<const uint32_t*
>(input);
273 for (
size_t i = 0, j = 0; j < 64; i++, j += 4) {
274 storage[i] = ((uint32_t)input[j ]) |
275 (((uint32_t)input[j+1]) << 8) |
276 (((uint32_t)input[j+2]) << 16) |
277 (((uint32_t)input[j+3]) << 24);
static void operation(T operation, uint32_t &a, uint32_t b, uint32_t c, uint32_t d, uint32_t x, uint8_t s, uint32_t t)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d