git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@4 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
tariq
2005-11-15 18:57:56 +00:00
parent 95b9a258a1
commit 192dbba0e4
26 changed files with 355 additions and 252 deletions

View File

@@ -431,7 +431,7 @@ int Blowfish::do_bf_setkey(byte * key, unsigned int keylen)
}
for (i = j = 0; i < BLOWFISH_ROUNDS + 2; ++i) {
#ifdef BIG_ENDIAN_HOST
#ifdef KEEPASS_BIG_ENDIAN
((byte *) & data)[0] = key[j];
((byte *) & data)[1] = key[(j + 1) % keylen];
((byte *) & data)[2] = key[(j + 2) % keylen];

View File

@@ -15,6 +15,7 @@
#ifndef BLOWFISH_H
#define BLOWFISH_H
#include "global.h"
#include <stdint.h>
#include <string>
using std::string;
@@ -68,7 +69,7 @@ protected:
uint32_t function_F( uint32_t x)
{
uint16_t a, b, c, d;
#ifdef BIG_ENDIAN_HOST
#ifdef KEEPASS_BIG_ENDIAN
a = ((byte *) & x)[0];
b = ((byte *) & x)[1];
c = ((byte *) & x)[2];
@@ -86,7 +87,7 @@ protected:
uint32_t *s0, uint32_t *s1, uint32_t *s2, uint32_t *s3)
{
l ^= p[i];
#ifdef BIG_ENDIAN_HOST
#ifdef KEEPASS_BIG_ENDIAN
r ^= (( s0[((byte*)&l)[0]] + s1[((byte*)&l)[1]])
^ s2[((byte*)&l)[2]]) + s3[((byte*)&l)[3]];
#else

View File

@@ -19,7 +19,7 @@
SHA1(A million repetitions of "a") =
34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
*/
#include "global.h"
#include "sha1.h"
#define SHA1_MAX_FILE_BUFFER 8000
@@ -33,7 +33,7 @@
#endif
#endif
#ifdef SHA1_LITTLE_ENDIAN
#ifdef KEEPASS_LITTLE_ENDIAN
#define SHABLK0(i) (m_block->l[i] = \
(ROL32(m_block->l[i],24) & 0xFF00FF00) | (ROL32(m_block->l[i],8) & 0x00FF00FF))
#else

View File

@@ -29,7 +29,7 @@
// If you're compiling big endian, just comment out the following line
#define SHA1_LITTLE_ENDIAN
// #define or #undef this, if you want the CSHA1 class to wipe all
// temporary variables after processing