From f6bf1e59f39dd3bb628451a53292407a7e2e29f4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 3 Nov 2008 18:50:15 +0000 Subject: Avoid using get_byte in Turing::generate. On my Q6600, went from 255 MiB/s to 289 MiB/s (13% faster), mostly because this allows use of asm bswap and fast word<->byte conversions. --- src/cipher/turing/turing.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/cipher/turing/turing.cpp b/src/cipher/turing/turing.cpp index 017b5cf1d..85a29ddfb 100644 --- a/src/cipher/turing/turing.cpp +++ b/src/cipher/turing/turing.cpp @@ -156,14 +156,11 @@ void Turing::generate() C += R[idx_12]; D += R[idx_5]; - for(u32bit k = 0; k != 4; ++k) - { - buffer[20*j+k ] = get_byte(k, A); - buffer[20*j+k+ 4] = get_byte(k, B); - buffer[20*j+k+ 8] = get_byte(k, C); - buffer[20*j+k+12] = get_byte(k, D); - buffer[20*j+k+16] = get_byte(k, E); - } + store_be(A, buffer + 20*j + 0); + store_be(B, buffer + 20*j + 4); + store_be(C, buffer + 20*j + 8); + store_be(D, buffer + 20*j + 12); + store_be(E, buffer + 20*j + 16); } position = 0; -- cgit v1.2.3