ia32 optimized version
| 403 | |
| 404 | // ia32 optimized version |
| 405 | void 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 |
no outgoing calls