padlock_cbc(void *in, void *out, size_t count, void *key, union padlock_cw *cw,
void *iv)
{
-#ifdef __GNUCLIKE_ASM
/* The .byte line is really VIA C3 "xcrypt-cbc" instruction */
__asm __volatile(
"pushf \n\t"
: "b" (key), "d" (cw)
: "cc", "memory"
);
-#endif
}
static void
((uint32_t *)result)[3] = 0x10325476;
((uint32_t *)result)[4] = 0xC3D2E1F0;
-#ifdef __GNUCLIKE_ASM
__asm __volatile(
".byte 0xf3, 0x0f, 0xa6, 0xc8" /* rep xsha1 */
: "+S"(in), "+D"(result)
: "c"(count), "a"(0)
);
-#endif
padlock_output_block((uint32_t *)result, (uint32_t *)out,
SHA1_HASH_LEN / sizeof(uint32_t));
((uint32_t *)result)[6] = 0x1F83D9AB;
((uint32_t *)result)[7] = 0x5BE0CD19;
-#ifdef __GNUCLIKE_ASM
__asm __volatile(
".byte 0xf3, 0x0f, 0xa6, 0xd0" /* rep xsha256 */
: "+S"(in), "+D"(result)
: "c"(count), "a"(0)
);
-#endif
padlock_output_block((uint32_t *)result, (uint32_t *)out,
SHA2_256_HASH_LEN / sizeof(uint32_t));