diff options
author | lloyd <[email protected]> | 2008-11-03 18:50:15 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-03 18:50:15 +0000 |
commit | f6bf1e59f39dd3bb628451a53292407a7e2e29f4 (patch) | |
tree | 8b7db49bf8b741d59a880022e460c02ad8d83afd /src | |
parent | 104795c6735256c293976d428a35657cdb46629a (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/cipher/turing/turing.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
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; |