Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

/ray/src/lib/crypto/check_crypto.cc File Reference

#include <lib/crypto/bcipherbase.h>
#include <lib/crypto/blowfishcipher.h>
#include <lib/crypto/twofishcipher.h>
#include <lib/crypto/shashbase.h>
#include <lib/crypto/rmd160hash.h>
#include <lib/crypto/sha0hash.h>
#include <lib/crypto/sha1hash.h>
#include <lib/crypto/crc32hash.h>
#include <lib/crypto/base64.h>
#include <lib/htime.h>
#include <stdio.h>
#include <string.h>

Include dependency graph for check_crypto.cc:

Include dependency graph

Go to the source code of this file.

Classes

struct  Base64_TEST
struct  BlowfishTEST
struct  HASH_TEST
struct  TwofishTEST

Functions

void FillRandom (char *_dest, size_t len)
int test_blowfish (struct BlowfishTEST *tst, BlowFishCipher *bfc, int *ntests)
int do_test_blowfish ()
int test_twofish (struct TwofishTEST *tst, TwoFishCipher *tfc, int keylen, int *ntests)
int do_test_twofish ()
int test_hash (SecureHashBase *sh, const char *mat_res, HASH_TEST *test)
int do_test_rmd160 ()
int do_test_sha0 ()
int do_test_sha1 ()
int do_test_crc32 ()
int base64_ctest (const char *str)
int do_test_base64 ()
int main ()

Variables

BlowfishTEST blowfish_tst []
TwofishTEST twofish_tst16 []
HASH_TEST rmd160_test []
HASH_TEST sha0_test []
HASH_TEST sha1_test []
HASH_TEST crc32_test []
Base64_TEST base64_test []
char * prg_name = "test_crypto"


Function Documentation

int base64_ctest const char *  str  )  [static]
 

Definition at line 824 of file check_crypto.cc.

References CritAssert, Base64Decoder::decode(), Base64Encoder::encode(), and ssize_t.

Referenced by do_test_base64().

int do_test_base64  )  [static]
 

Definition at line 931 of file check_crypto.cc.

References base64_ctest(), base64_test, CritAssert, Base64Encoder::EncodeBuf(), FillRandom(), Base64_TEST::res, ssize_t, and Base64_TEST::txt.

Referenced by main().

int do_test_blowfish  )  [static]
 

Definition at line 149 of file check_crypto.cc.

References blowfish_tst, and test_blowfish().

Referenced by main().

int do_test_crc32  )  [static]
 

Definition at line 812 of file check_crypto.cc.

References crc32_test, and test_hash().

Referenced by main().

int do_test_rmd160  )  [static]
 

Definition at line 736 of file check_crypto.cc.

References rmd160_test, and test_hash().

Referenced by main().

int do_test_sha0  )  [static]
 

Definition at line 759 of file check_crypto.cc.

References sha0_test, and test_hash().

Referenced by main().

int do_test_sha1  )  [static]
 

Definition at line 783 of file check_crypto.cc.

References sha1_test, and test_hash().

Referenced by main().

int do_test_twofish  )  [static]
 

Definition at line 595 of file check_crypto.cc.

References test_twofish(), and twofish_tst16.

Referenced by main().

void FillRandom char *  _dest,
size_t  len
[static]
 

Definition at line 35 of file check_crypto.cc.

Referenced by do_test_base64().

int main  ) 
 

Definition at line 1009 of file check_crypto.cc.

References do_test_base64(), do_test_blowfish(), do_test_crc32(), do_test_rmd160(), do_test_sha0(), do_test_sha1(), do_test_twofish(), and HTime::Get().

int test_blowfish struct BlowfishTEST tst,
BlowFishCipher bfc,
int *  ntests
[static]
 

Definition at line 108 of file check_crypto.cc.

References BlowFishCipher::DecryptBlock(), BlowFishCipher::EncryptBlock(), BlowfishTEST::key, and BlowFishCipher::SetKey().

Referenced by do_test_blowfish().

int test_hash SecureHashBase sh,
const char *  mat_res,
HASH_TEST test
[static]
 

Definition at line 625 of file check_crypto.cc.

References CritAssert, SecureHashBase::feed(), SecureHashBase::final(), SecureHashBase::GetHash(), SecureHashBase::GetPar(), malloc, HASH_TEST::msg, HASH_TEST::res, and SecureHashBase::reset().

Referenced by do_test_crc32(), do_test_rmd160(), do_test_sha0(), and do_test_sha1().

int test_twofish struct TwofishTEST tst,
TwoFishCipher tfc,
int  keylen,
int *  ntests
 

Definition at line 561 of file check_crypto.cc.

References TwoFishCipher::DecryptBlock(), TwoFishCipher::EncryptBlock(), TwofishTEST::key, and TwoFishCipher::SetKey().

Referenced by do_test_twofish().


Variable Documentation

struct Base64_TEST base64_test[] [static]
 

Referenced by do_test_base64().

struct BlowfishTEST blowfish_tst[]
 

Referenced by do_test_blowfish().

struct HASH_TEST crc32_test[] [static]
 

Initial value:

{
    { "",
      "\xff\xff\xff\xff" },
    { "a",
      "\x48\xc2\x79\xfe" },
    { "abc",
      "\x48\xaa\x78\xa2" },
    { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
      "\x97\xd3\x2c\x84" },
    { "12345678901234567890123456789012345678901234567890123456789012345678901234567890",
      "\x73\xa0\xb3\xa8" },
    { NULL,NULL }
}

Definition at line 797 of file check_crypto.cc.

Referenced by do_test_crc32().

char* prg_name = "test_crypto"
 

Definition at line 1007 of file check_crypto.cc.

Referenced by main().

struct HASH_TEST rmd160_test[] [static]
 

Initial value:

{
    { "",
      "\x9c\x11\x85\xa5\xc5\xe9\xfc\x54\x61\x28\x08\x97\x7e\xe8\xf5\x48\xb2\x25\x8d\x31" },
    { "a",
      "\x0b\xdc\x9d\x2d\x25\x6b\x3e\xe9\xda\xae\x34\x7b\xe6\xf4\xdc\x83\x5a\x46\x7f\xfe" },
    { "abc",
      "\x8e\xb2\x08\xf7\xe0\x5d\x98\x7a\x9b\x04\x4a\x8e\x98\xc6\xb0\x87\xf1\x5a\x0b\xfc" },
    { "message digest",
      "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8\x81\xb1\x23\xa8\x5f\xfa\x21\x59\x5f\x36" },
    { "abcdefghijklmnopqrstuvwxyz",
      "\xf7\x1c\x27\x10\x9c\x69\x2c\x1b\x56\xbb\xdc\xeb\x5b\x9d\x28\x65\xb3\x70\x8d\xbc" },
    { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
      "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05\xa0\x6c\x27\xdc\xf4\x9a\xda\x62\xeb\x2b" },
    { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
      "\xb0\xe2\x0b\x6e\x31\x16\x64\x02\x86\xed\x3a\x87\xa5\x71\x30\x79\xb2\x1f\x51\x89" },
    { "12345678901234567890123456789012345678901234567890123456789012345678901234567890",
      "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb\xd3\x32\x3c\xab\x82\xbf\x63\x32\x6b\xfb" },
    { NULL,NULL }
}

Definition at line 715 of file check_crypto.cc.

Referenced by do_test_rmd160().

struct HASH_TEST sha0_test[] [static]
 

Initial value:

{
    { "abc",
      "\x01\x64\xb8\xa9\x14\xcd\x2a\x5e\x74\xc4\xf7\xff\x08\x2c\x4d\x97\xf1\xed\xf8\x80" },
    { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
      "\xd2\x51\x6e\xe1\xac\xfa\x5b\xaf\x33\xdf\xc1\xc4\x71\xe4\x38\x44\x9e\xf1\x34\xc8" },
    { NULL,NULL }
}

Definition at line 750 of file check_crypto.cc.

Referenced by do_test_sha0().

struct HASH_TEST sha1_test[] [static]
 

Initial value:

{
    { "abc",
      "\xa9\x99\x3e\x36\x47\x06\x81\x6a\xba\x3e\x25\x71\x78\x50\xc2\x6c\x9c\xd0\xd8\x9d" },
    { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
      "\x84\x98\x3e\x44\x1c\x3b\xd2\x6e\xba\xae\x4a\xa1\xf9\x51\x29\xe5\xe5\x46\x70\xf1" },
    { NULL,NULL }
}

Definition at line 774 of file check_crypto.cc.

Referenced by do_test_sha1().

struct TwofishTEST twofish_tst16[]
 

Referenced by do_test_twofish().


Generated on Sat Feb 19 22:33:51 2005 for Ray by doxygen 1.3.5