MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / Process

Method Process

extra/yassl/taocrypt/src/des.cpp:405–446  ·  view source on GitHub ↗

ia32 optimized version

Source from the content-addressed store, hash-verified

403
404// ia32 optimized version
405void DES_EDE3::Process(byte* out, const byte* in, word32 sz)
406{
407 if (!isMMX) {
408 Mode_BASE::Process(out, in, sz);
409 return;
410 }
411
412 word32 blocks = sz / DES_BLOCK_SIZE;
413
414 if (mode_ == CBC)
415 if (dir_ == ENCRYPTION)
416 while (blocks--) {
417 r_[0] ^= *(word32*)in;
418 r_[1] ^= *(word32*)(in + 4);
419
420 AsmProcess((byte*)r_, (byte*)r_, (void*)Spbox);
421
422 memcpy(out, r_, DES_BLOCK_SIZE);
423
424 in += DES_BLOCK_SIZE;
425 out += DES_BLOCK_SIZE;
426 }
427 else
428 while (blocks--) {
429 AsmProcess(in, out, (void*)Spbox);
430
431 *(word32*)out ^= r_[0];
432 *(word32*)(out + 4) ^= r_[1];
433
434 memcpy(r_, in, DES_BLOCK_SIZE);
435
436 out += DES_BLOCK_SIZE;
437 in += DES_BLOCK_SIZE;
438 }
439 else
440 while (blocks--) {
441 AsmProcess(in, out, (void*)Spbox);
442
443 out += DES_BLOCK_SIZE;
444 in += DES_BLOCK_SIZE;
445 }
446}
447
448#endif // DO_DES_ASM
449

Callers 13

bench_desFunction · 0.45
bench_aesFunction · 0.45
bench_twofishFunction · 0.45
bench_blowfishFunction · 0.45
bench_arc4Function · 0.45
arc4_testFunction · 0.45
rabbit_testFunction · 0.45
hc128_testFunction · 0.45
des_testFunction · 0.45
aes_testFunction · 0.45
twofish_testFunction · 0.45
blowfish_testFunction · 0.45

Calls

no outgoing calls

Tested by 7

arc4_testFunction · 0.36
rabbit_testFunction · 0.36
hc128_testFunction · 0.36
des_testFunction · 0.36
aes_testFunction · 0.36
twofish_testFunction · 0.36
blowfish_testFunction · 0.36