aboutsummaryrefslogtreecommitdiff
path: root/src/experimental/blowfish.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-04-07 21:46:17 +0000
committerMike Buland <eichlan@xagasoft.com>2012-04-07 21:46:17 +0000
commitb93f18e1dd303fb648bc350416f7f5ace536fd1f (patch)
tree636bf4dfafcf2e9aef30db19a4e2f9cd12cb36d4 /src/experimental/blowfish.h
parent2c6cbad869b0e60b37859c3c4f0c850721d057ce (diff)
downloadlibbu++-b93f18e1dd303fb648bc350416f7f5ace536fd1f.tar.gz
libbu++-b93f18e1dd303fb648bc350416f7f5ace536fd1f.tar.bz2
libbu++-b93f18e1dd303fb648bc350416f7f5ace536fd1f.tar.xz
libbu++-b93f18e1dd303fb648bc350416f7f5ace536fd1f.zip
Blowfish now passes all standard test vectors on little endian. I don't know
about big endian...we can hope.
Diffstat (limited to 'src/experimental/blowfish.h')
-rw-r--r--src/experimental/blowfish.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/experimental/blowfish.h b/src/experimental/blowfish.h
index fb46dfd..054fc82 100644
--- a/src/experimental/blowfish.h
+++ b/src/experimental/blowfish.h
@@ -29,24 +29,24 @@ namespace Bu
29 using Bu::Stream::write; 29 using Bu::Stream::write;
30 30
31 private: 31 private:
32 unsigned int PA[NUM_SUBKEYS]; 32 uint32_t PA[NUM_SUBKEYS];
33 unsigned int SB[NUM_S_BOXES][NUM_ENTRIES]; 33 uint32_t SB[NUM_S_BOXES][NUM_ENTRIES];
34 34
35#if __BYTE_ORDER == __BIG_ENDIAN 35#if __BYTE_ORDER == __BIG_ENDIAN
36 struct WordByte 36 struct WordByte
37 { 37 {
38 unsigned int zero:8; 38 uint32_t zero:8;
39 unsigned int one:8; 39 uint32_t one:8;
40 unsigned int two:8; 40 uint32_t two:8;
41 unsigned int three:8; 41 uint32_t three:8;
42 }; 42 };
43#elif __BYTE_ORDER == __LITTLE_ENDIAN 43#elif __BYTE_ORDER == __LITTLE_ENDIAN
44 struct WordByte 44 struct WordByte
45 { 45 {
46 unsigned int three:8; 46 uint32_t three:8;
47 unsigned int two:8; 47 uint32_t two:8;
48 unsigned int one:8; 48 uint32_t one:8;
49 unsigned int zero:8; 49 uint32_t zero:8;
50 }; 50 };
51#else 51#else
52#error No endianness defined 52#error No endianness defined
@@ -54,7 +54,7 @@ namespace Bu
54 54
55 union Word 55 union Word
56 { 56 {
57 unsigned int word; 57 uint32_t word;
58 WordByte byte; 58 WordByte byte;
59 }; 59 };
60 60