Classes | |
| class | AES |
| class | AbstractGroup |
| class | AbstractRing |
| class | AbstractEuclideanDomain |
| class | EuclideanDomainOf |
| class | ARC4 |
| class | BER_Decoder |
| class | RSA_Private_Decoder |
| class | RSA_Public_Decoder |
| class | DSA_Private_Decoder |
| class | DSA_Public_Decoder |
| class | DH_Decoder |
| class | PublicKey |
| class | Signer |
| class | CertDecoder |
| class | DER_Encoder |
| class | Signature_Encoder |
| class | AllocatorBase |
| class | AllocatorWithCleanup |
| class | Block |
| class | Blowfish |
| class | HexEncoder |
| class | HexDecoder |
| class | Base64Encoder |
| class | Base64Decoder |
| class | BasicDES |
| class | DES |
| class | DES_EDE2 |
| class | DES_EDE3 |
| class | DH |
| class | DSA_PublicKey |
| class | DSA_PrivateKey |
| class | DSA_Signer |
| class | DSA_Verifier |
| struct | Error |
| class | Source |
| class | FileSource |
| class | FileSink |
| class | HASH |
| class | HASHwithTransform |
| class | HMAC |
| class | Integer |
| class | MD2 |
| class | MD4 |
| class | MD5 |
| class | virtual_base |
| struct | CompileAssert |
| struct | EnumToType |
| class | GetBlock |
| class | PutBlock |
| struct | BlockGetAndPut |
| struct | SafeShifter< true > |
| struct | SafeShifter< false > |
| class | ModularArithmetic |
| class | MontgomeryRepresentation |
| do modular arithmetics in Montgomery representation for increased speed More... | |
| class | BlockCipher |
| class | Mode_BASE |
| class | PBKDF2_HMAC |
| class | OS_Seed |
| class | RandomNumberGenerator |
| class | RIPEMD160 |
| class | PK_Lengths |
| class | RSA_PublicKey |
| class | RSA_PrivateKey |
| class | RSA_BlockType2 |
| class | RSA_BlockType1 |
| class | RSA_Encryptor |
| class | RSA_Decryptor |
| class | SHA |
| class | Twofish |
| class | IsFundamentalType |
| struct | WindowSlider |
| class | DWord |
| class | Word |
| class | Portable |
| class | BadBER |
Typedefs | |
| typedef BlockCipher< ENCRYPTION, AES, ECB > | AES_ECB_Encryption |
| typedef BlockCipher< DECRYPTION, AES, ECB > | AES_ECB_Decryption |
| typedef BlockCipher< ENCRYPTION, AES, CBC > | AES_CBC_Encryption |
| typedef BlockCipher< DECRYPTION, AES, CBC > | AES_CBC_Decryption |
| typedef mySTL::list< Signer * > | SignerList |
| typedef Block< byte > | ByteBlock |
| typedef Block< word > | WordBlock |
| typedef Block< word32 > | Word32Block |
| typedef BlockCipher< ENCRYPTION, Blowfish, ECB > | Blowfish_ECB_Encryption |
| typedef BlockCipher< DECRYPTION, Blowfish, ECB > | Blowfish_ECB_Decryption |
| typedef BlockCipher< ENCRYPTION, Blowfish, CBC > | Blowfish_CBC_Encryption |
| typedef BlockCipher< DECRYPTION, Blowfish, CBC > | Blowfish_CBC_Decryption |
| typedef BlockCipher< ENCRYPTION, DES, ECB > | DES_ECB_Encryption |
| typedef BlockCipher< DECRYPTION, DES, ECB > | DES_ECB_Decryption |
| typedef BlockCipher< ENCRYPTION, DES, CBC > | DES_CBC_Encryption |
| typedef BlockCipher< DECRYPTION, DES, CBC > | DES_CBC_Decryption |
| typedef BlockCipher< ENCRYPTION, DES_EDE2, ECB > | DES_EDE2_ECB_Encryption |
| typedef BlockCipher< DECRYPTION, DES_EDE2, ECB > | DES_EDE2_ECB_Decryption |
| typedef BlockCipher< ENCRYPTION, DES_EDE2, CBC > | DES_EDE2_CBC_Encryption |
| typedef BlockCipher< DECRYPTION, DES_EDE2, CBC > | DES_EDE2_CBC_Decryption |
| typedef BlockCipher< ENCRYPTION, DES_EDE3, ECB > | DES_EDE3_ECB_Encryption |
| typedef BlockCipher< DECRYPTION, DES_EDE3, ECB > | DES_EDE3_ECB_Decryption |
| typedef BlockCipher< ENCRYPTION, DES_EDE3, CBC > | DES_EDE3_CBC_Encryption |
| typedef BlockCipher< DECRYPTION, DES_EDE3, CBC > | DES_EDE3_CBC_Decryption |
| typedef WordBlock | AlignedWordBlock |
| typedef EnumToType< ByteOrder, LittleEndianOrder > | LittleEndian |
| typedef EnumToType< ByteOrder, BigEndianOrder > | BigEndian |
| typedef LittleEndian | HostByteOrder |
| typedef RSA_Encryptor | RSAES_Encryptor |
| typedef RSA_Decryptor | RSAES_Decryptor |
| typedef BlockCipher< ENCRYPTION, Twofish, ECB > | Twofish_ECB_Encryption |
| typedef BlockCipher< DECRYPTION, Twofish, ECB > | Twofish_ECB_Decryption |
| typedef BlockCipher< ENCRYPTION, Twofish, CBC > | Twofish_CBC_Encryption |
| typedef BlockCipher< DECRYPTION, Twofish, CBC > | Twofish_CBC_Decryption |
| typedef unsigned char | byte |
| typedef unsigned short | word16 |
| typedef unsigned int | word32 |
| typedef byte | hword |
| typedef word16 | word |
| typedef word32 | dword |
| typedef BlockGetAndPut< word32, BigEndian > | gpBlock |
| typedef BlockGetAndPut< word32, BigEndian > | gpBlock |
| typedef BlockGetAndPut< word32, BigEndian > | Block |
| typedef Portable | LowLevel |
| typedef BlockGetAndPut< word32, LittleEndian > | gpBlock |
Enumerations | |
| enum | { AES_BLOCK_SIZE = 16 } |
| enum | ASNTag { BOOLEAN = 0x01, INTEGER = 0x02, BIT_STRING = 0x03, OCTET_STRING = 0x04, TAG_NULL = 0x05, OBJECT_IDENTIFIER = 0x06, OBJECT_DESCRIPTOR = 0x07, EXTERNAL = 0x08, REAL = 0x09, ENUMERATED = 0x0a, UTF8_STRING = 0x0c, SEQUENCE = 0x10, SET = 0x11, NUMERIC_STRING = 0x12, PRINTABLE_STRING = 0x13, T61_STRING = 0x14, VIDEOTEXT_STRING = 0x15, IA5_STRING = 0x16, UTC_TIME = 0x17, GENERALIZED_TIME = 0x18, GRAPHIC_STRING = 0x19, VISIBLE_STRING = 0x1a, GENERAL_STRING = 0x1b, LONG_LENGTH = 0x80 } |
| enum | ASNIdFlag { UNIVERSAL = 0x00, DATA = 0x01, HEADER = 0x02, CONSTRUCTED = 0x20, APPLICATION = 0x40, CONTEXT_SPECIFIC = 0x80, PRIVATE = 0xc0 } |
| enum | DNTags { COMMON_NAME = 0x03, SUR_NAME = 0x04, COUNTRY_NAME = 0x06, LOCALITY_NAME = 0x07, STATE_NAME = 0x08, ORG_NAME = 0x0a, ORGUNIT_NAME = 0x0b } |
| enum | Constants { MIN_DATE_SZ = 13, MAX_DATE_SZ = 16, MAX_ALGO_SZ = 16, MAX_LENGTH_SZ = 5, MAX_SEQ_SZ = 5, MAX_ALGO_SIZE = 9, MAX_DIGEST_SZ = 25, DSA_SIG_SZ = 40, ASN_NAME_MAX = 512 } |
| enum | { SHA_SIZE = 20 } |
| enum | SigType { SHAwDSA = 517, MD2wRSA = 646, MD5wRSA = 648, SHAwRSA = 649 } |
| enum | HashType { MD2h = 646, MD5h = 649, SHAh = 88 } |
| enum | KeyType { DSAk = 515, RSAk = 645 } |
| enum | { BLOWFISH_BLOCK_SIZE = 8 } |
| enum | { DES_BLOCK_SIZE = 8, DES_KEY_SIZE = 32 } |
| enum | ErrorNumber { NO_ERROR = 0, WINCRYPT_E = 1001, CRYPTGEN_E = 1002, OPEN_RAN_E = 1003, READ_RAN_E = 1004, INTEGER_E = 1010, SEQUENCE_E = 1020, SET_E = 1021, VERSION_E = 1022, SIG_OID_E = 1023, BIT_STR_E = 1024, UNKNOWN_OID_E = 1025, OBJECT_ID_E = 1026, TAG_NULL_E = 1027, EXPECT_0_E = 1028, OCTET_STR_E = 1029, TIME_E = 1030, DATE_SZ_E = 1031, SIG_LEN_E = 1032, UNKOWN_SIG_E = 1033, UNKOWN_HASH_E = 1034, DSA_SZ_E = 1035, BEFORE_DATE_E = 1036, AFTER_DATE_E = 1037, SIG_CONFIRM_E = 1038, SIG_OTHER_E = 1039 } |
| enum | ByteOrder { LittleEndianOrder = 0, BigEndianOrder = 1 } |
| enum | CipherDir { ENCRYPTION, DECRYPTION } |
| enum | Mode { ECB, CBC } |
| enum | { TWOFISH_BLOCK_SIZE = 16 } |
Functions | |
| word32 | GetLength (Source &) |
| word32 | SetLength (word32, byte *) |
| word32 | SetSequence (word32, byte *) |
| word32 | EncodeDSA_Signature (const byte *signature, byte *output) |
| word32 | EncodeDSA_Signature (const Integer &r, const Integer &s, byte *output) |
| word32 | DecodeDSA_Signature (byte *decoded, const byte *encoded, word32 sz) |
| template<typename T, class A> | |
| A::pointer | StdReallocate (A &a, T *p, typename A::size_type oldSize, typename A::size_type newSize, bool preserve) |
| template<typename T> | |
| const T & | min (const T &a, const T &b) |
| template<typename T> | |
| const T & | max (const T &a, const T &b) |
| bool | operator== (const Integer &a, const Integer &b) |
| bool | operator!= (const Integer &a, const Integer &b) |
| bool | operator> (const Integer &a, const Integer &b) |
| bool | operator>= (const Integer &a, const Integer &b) |
| bool | operator< (const Integer &a, const Integer &b) |
| bool | operator<= (const Integer &a, const Integer &b) |
| Integer | operator+ (const Integer &a, const Integer &b) |
| Integer | operator- (const Integer &a, const Integer &b) |
| Integer | operator * (const Integer &a, const Integer &b) |
| Integer | operator/ (const Integer &a, const Integer &b) |
| Integer | operator% (const Integer &a, const Integer &b) |
| Integer | operator/ (const Integer &a, word b) |
| word | operator% (const Integer &a, word b) |
| void | swap (Integer &a, Integer &b) |
| Integer | CRT (const Integer &xp, const Integer &p, const Integer &xq, const Integer &q, const Integer &u) |
| Integer | ModularExponentiation (const Integer &a, const Integer &e, const Integer &m) |
| Integer | ModularRoot (const Integer &a, const Integer &dp, const Integer &dq, const Integer &p, const Integer &q, const Integer &u) |
| void | swap (MD2 &a, MD2 &b) |
| void | swap (MD4 &a, MD4 &b) |
| void | swap (MD5 &a, MD5 &b) |
| void | CleanUp () |
| template<typename T> | |
| void | tcDelete (T *ptr) |
| template<typename T> | |
| void | tcArrayDelete (T *ptr) |
| unsigned int | BitsToBytes (unsigned int bitCount) |
| unsigned int | BytesToWords (unsigned int byteCount) |
| unsigned int | BitsToWords (unsigned int bitCount) |
| void | CopyWords (word *r, const word *a, word32 n) |
| unsigned int | CountWords (const word *X, unsigned int N) |
| void | SetWords (word *r, word a, unsigned int n) |
| CipherDir | ReverseDir (CipherDir dir) |
| ByteOrder | GetHostByteOrder () |
| bool | HostByteOrderIs (ByteOrder order) |
| void | xorbuf (byte *, const byte *, unsigned int) |
| template<class T> | |
| bool | IsPowerOf2 (T n) |
| template<class T1, class T2> | |
| T2 | ModPowerOf2 (T1 a, T2 b) |
| template<class T> | |
| T | RoundDownToMultipleOf (T n, T m) |
| template<class T> | |
| T | RoundUpToMultipleOf (T n, T m) |
| template<class T> | |
| unsigned int | GetAlignment (T *dummy=0) |
| bool | IsAlignedOn (const void *p, unsigned int alignment) |
| template<class T> | |
| bool | IsAligned (const void *p, T *dummy=0) |
| template<class T> | |
| T | rotlFixed (T x, unsigned int y) |
| template<class T> | |
| T | rotrFixed (T x, unsigned int y) |
| word32 | min (word32 a, word32 b) |
| word32 | ByteReverse (word32 value) |
| template<typename T> | |
| void | ByteReverse (T *out, const T *in, word32 byteCount) |
| void | ByteReverse (byte *out, const byte *in, word32 byteCount) |
| template<class T> | |
| T | ByteReverseIf (T value, ByteOrder order) |
| template<typename T> | |
| void | ByteReverseIf (T *out, const T *in, word32 bc, ByteOrder order) |
| template<class T> | |
| void | GetUserKey (ByteOrder order, T *out, word32 outlen, const byte *in, word32 inlen) |
| byte | UnalignedGetWordNonTemplate (ByteOrder order, const byte *block, byte *) |
| word16 | UnalignedGetWordNonTemplate (ByteOrder order, const byte *block, word16 *) |
| word32 | UnalignedGetWordNonTemplate (ByteOrder order, const byte *block, word32 *) |
| template<class T> | |
| T | UnalignedGetWord (ByteOrder order, const byte *block, T *dummy=0) |
| void | UnalignedPutWord (ByteOrder order, byte *block, byte value, const byte *xorBlock=0) |
| void | UnalignedPutWord (ByteOrder order, byte *block, word16 value, const byte *xorBlock=0) |
| void | UnalignedPutWord (ByteOrder order, byte *block, word32 value, const byte *xorBlock=0) |
| template<class T> | |
| T | GetWord (bool assumeAligned, ByteOrder order, const byte *block) |
| template<class T> | |
| void | GetWord (bool assumeAligned, ByteOrder order, T &result, const byte *block) |
| template<class T> | |
| void | PutWord (bool assumeAligned, ByteOrder order, byte *block, T value, const byte *xorBlock=0) |
| template<unsigned int bits, class T> | |
| T | SafeRightShift (T value) |
| template<unsigned int bits, class T> | |
| T | SafeLeftShift (T value) |
| word | ShiftWordsLeftByBits (word *r, unsigned int n, unsigned int shiftBits) |
| word | ShiftWordsRightByBits (word *r, unsigned int n, unsigned int shiftBits) |
| void | ShiftWordsLeftByWords (word *r, unsigned int n, unsigned int shiftWords) |
| void | ShiftWordsRightByWords (word *r, unsigned int n, unsigned int shiftWords) |
| template<class T1, class T2> | |
| T1 | SaturatingSubtract (T1 a, T2 b) |
| unsigned int | BytePrecision (unsigned long value) |
| unsigned int | BitPrecision (unsigned long) |
| unsigned long | Crop (unsigned long value, unsigned int size) |
| void | swap (RIPEMD160 &a, RIPEMD160 &b) |
| word32 | SSL_Decrypt (const RSA_PublicKey &key, const byte *sig, byte *plain) |
| void | swap (SHA &a, SHA &b) |
| unsigned int | MakeByte (word32 &x, word32 &y, byte *s) |
| bool | operator> (tm &a, tm &b) |
| bool | operator< (tm &a, tm &b) |
| word32 | btoi (byte b) |
| void | GetTime (int &value, const byte *date, int &i) |
| bool | ValidateDate (const byte *date, byte format, CertDecoder::DateType dt) |
| static void | IPERM (word32 &left, word32 &right) |
| static void | FPERM (word32 &left, word32 &right) |
| unsigned int | DiscreteLogWorkFactor (unsigned int n) |
| template<class S, class D> | |
| S | DivideThreeWordsByTwo (S *A, S B0, S B1, D *dummy_VC6_WorkAround=0) |
| template<class S, class D> | |
| D | DivideFourWordsByTwo (S *T, const D &Al, const D &Ah, const D &B) |
| static unsigned int | RoundupSize (unsigned int n) |
| static int | Compare (const word *A, const word *B, unsigned int N) |
| static word | Increment (word *A, unsigned int N, word B=1) |
| static word | Decrement (word *A, unsigned int N, word B=1) |
| static void | TwosComplement (word *A, unsigned int N) |
| static word | LinearMultiply (word *C, const word *A, word B, unsigned int N) |
| static word | AtomicInverseModPower2 (word A) |
| void | RecursiveMultiply (word *R, word *T, const word *A, const word *B, unsigned int N) |
| void | RecursiveSquare (word *R, word *T, const word *A, unsigned int N) |
| void | RecursiveMultiplyBottom (word *R, word *T, const word *A, const word *B, unsigned int N) |
| void | RecursiveMultiplyTop (word *R, word *T, const word *L, const word *A, const word *B, unsigned int N) |
| word | Add (word *C, const word *A, const word *B, unsigned int N) |
| word | Subtract (word *C, const word *A, const word *B, unsigned int N) |
| void | Multiply (word *R, word *T, const word *A, const word *B, unsigned int N) |
| void | Square (word *R, word *T, const word *A, unsigned int N) |
| void | AsymmetricMultiply (word *R, word *T, const word *A, unsigned int NA, const word *B, unsigned int NB) |
| void | PositiveMultiply (Integer &product, const Integer &a, const Integer &b) |
| void | Multiply (Integer &product, const Integer &a, const Integer &b) |
| static unsigned int | EvenWordCount (const word *X, unsigned int N) |
| unsigned int | AlmostInverse (word *R, word *T, const word *A, unsigned int NA, const word *M, unsigned int N) |
| void | DivideByPower2Mod (word *R, const word *A, unsigned int k, const word *M, unsigned int N) |
| void | MultiplyByPower2Mod (word *R, const word *A, unsigned int k, const word *M, unsigned int N) |
| void | PositiveAdd (Integer &sum, const Integer &a, const Integer &b) |
| void | PositiveSubtract (Integer &diff, const Integer &a, const Integer &b) |
| static void | AtomicDivide (word *Q, const word *A, const word *B) |
| static void | CorrectQuotientEstimate (word *R, word *T, word *Q, const word *B, unsigned int N) |
| void | Divide (word *R, word *Q, word *T, const word *A, unsigned int NA, const word *B, unsigned int NB) |
| void | PositiveDivide (Integer &remainder, Integer "ient, const Integer &a, const Integer &b) |
| Integer | a_times_b_mod_c (const Integer &x, const Integer &y, const Integer &m) |
| Integer | a_exp_b_mod_c (const Integer &x, const Integer &e, const Integer &m) |
| void | MultiplyBottom (word *R, word *T, const word *A, const word *B, unsigned int N) |
| void | MultiplyTop (word *R, word *T, const word *L, const word *A, const word *B, unsigned int N) |
| void | MontgomeryReduce (word *R, word *T, const word *X, const word *M, const word *U, unsigned int N) |
| void | RecursiveInverseModPower2 (word *R, word *T, const word *A, unsigned int N) |
| void | XorWords (word *r, const word *a, unsigned int n) |
| static unsigned int | Mod (unsigned int c) |
| static word32 | ReedSolomon (word32 high, word32 low) |
Variables | |
| const word32 | WORD_SIZE = sizeof(word) |
| const word32 | WORD_BITS = WORD_SIZE * 8 |
| const byte | bad = 0xFF |
| const byte | hexEncode [] |
| const byte | hexDecode [] |
| const byte | base64Encode [] |
| const byte | base64Decode [] |
| const byte | pad = '=' |
| const int | pemLineSz = 64 |
| static const byte | pc1 [] |
| static const byte | totrot [] |
| static const byte | pc2 [] |
| static const int | bytebit [] |
| const word32 | Spbox [8][64] |
| static const unsigned int | RoundupSizeTable [] = {2, 2, 2, 4, 4, 8, 8, 8, 8} |
| static Integer * | zero = 0 |
| static Integer * | one = 0 |
| typedef BlockCipher<ENCRYPTION, AES, ECB> TaoCrypt::AES_ECB_Encryption |
| typedef BlockCipher<DECRYPTION, AES, ECB> TaoCrypt::AES_ECB_Decryption |
| typedef BlockCipher<ENCRYPTION, AES, CBC> TaoCrypt::AES_CBC_Encryption |
| typedef BlockCipher<DECRYPTION, AES, CBC> TaoCrypt::AES_CBC_Decryption |
| typedef mySTL::list<Signer*> TaoCrypt::SignerList |
| typedef Block<byte> TaoCrypt::ByteBlock |
| typedef Block<word> TaoCrypt::WordBlock |
| typedef Block<word32> TaoCrypt::Word32Block |
| typedef BlockCipher<ENCRYPTION, Blowfish, ECB> TaoCrypt::Blowfish_ECB_Encryption |
Definition at line 72 of file blowfish.hpp.
| typedef BlockCipher<DECRYPTION, Blowfish, ECB> TaoCrypt::Blowfish_ECB_Decryption |
Definition at line 73 of file blowfish.hpp.
| typedef BlockCipher<ENCRYPTION, Blowfish, CBC> TaoCrypt::Blowfish_CBC_Encryption |
Definition at line 75 of file blowfish.hpp.
| typedef BlockCipher<DECRYPTION, Blowfish, CBC> TaoCrypt::Blowfish_CBC_Decryption |
Definition at line 76 of file blowfish.hpp.
| typedef BlockCipher<ENCRYPTION, DES, ECB> TaoCrypt::DES_ECB_Encryption |
| typedef BlockCipher<DECRYPTION, DES, ECB> TaoCrypt::DES_ECB_Decryption |
| typedef BlockCipher<ENCRYPTION, DES, CBC> TaoCrypt::DES_CBC_Encryption |
| typedef BlockCipher<DECRYPTION, DES, CBC> TaoCrypt::DES_CBC_Decryption |
| typedef BlockCipher<ENCRYPTION, DES_EDE2, ECB> TaoCrypt::DES_EDE2_ECB_Encryption |
| typedef BlockCipher<DECRYPTION, DES_EDE2, ECB> TaoCrypt::DES_EDE2_ECB_Decryption |
| typedef BlockCipher<ENCRYPTION, DES_EDE2, CBC> TaoCrypt::DES_EDE2_CBC_Encryption |
| typedef BlockCipher<DECRYPTION, DES_EDE2, CBC> TaoCrypt::DES_EDE2_CBC_Decryption |
| typedef BlockCipher<ENCRYPTION, DES_EDE3, ECB> TaoCrypt::DES_EDE3_ECB_Encryption |
| typedef BlockCipher<DECRYPTION, DES_EDE3, ECB> TaoCrypt::DES_EDE3_ECB_Decryption |
| typedef BlockCipher<ENCRYPTION, DES_EDE3, CBC> TaoCrypt::DES_EDE3_CBC_Encryption |
| typedef BlockCipher<DECRYPTION, DES_EDE3, CBC> TaoCrypt::DES_EDE3_CBC_Decryption |
| typedef WordBlock TaoCrypt::AlignedWordBlock |
Definition at line 112 of file integer.hpp.
| typedef EnumToType<ByteOrder, LittleEndianOrder> TaoCrypt::LittleEndian |
| typedef EnumToType<ByteOrder, BigEndianOrder> TaoCrypt::BigEndian |
| typedef LittleEndian TaoCrypt::HostByteOrder |
| typedef BlockCipher<ENCRYPTION, Twofish, ECB> TaoCrypt::Twofish_ECB_Encryption |
Definition at line 79 of file twofish.hpp.
| typedef BlockCipher<DECRYPTION, Twofish, ECB> TaoCrypt::Twofish_ECB_Decryption |
Definition at line 80 of file twofish.hpp.
| typedef BlockCipher<ENCRYPTION, Twofish, CBC> TaoCrypt::Twofish_CBC_Encryption |
Definition at line 82 of file twofish.hpp.
| typedef BlockCipher<DECRYPTION, Twofish, CBC> TaoCrypt::Twofish_CBC_Decryption |
Definition at line 83 of file twofish.hpp.
| typedef unsigned char TaoCrypt::byte |
| typedef unsigned short TaoCrypt::word16 |
| typedef unsigned int TaoCrypt::word32 |
| typedef byte TaoCrypt::hword |
| typedef word16 TaoCrypt::word |
| typedef word32 TaoCrypt::dword |
| typedef BlockGetAndPut<word32, BigEndian> TaoCrypt::gpBlock |
| typedef BlockGetAndPut<word32, BigEndian> TaoCrypt::gpBlock |
Definition at line 205 of file blowfish.cpp.
| typedef BlockGetAndPut<word32, BigEndian> TaoCrypt::Block |
| typedef Portable TaoCrypt::LowLevel |
Definition at line 1727 of file integer.cpp.
| typedef BlockGetAndPut<word32, LittleEndian> TaoCrypt::gpBlock |
Definition at line 228 of file twofish.cpp.
| anonymous enum |
| enum TaoCrypt::ASNTag |
Definition at line 44 of file asn.hpp.
00045 { 00046 BOOLEAN = 0x01, 00047 INTEGER = 0x02, 00048 BIT_STRING = 0x03, 00049 OCTET_STRING = 0x04, 00050 TAG_NULL = 0x05, 00051 OBJECT_IDENTIFIER = 0x06, 00052 OBJECT_DESCRIPTOR = 0x07, 00053 EXTERNAL = 0x08, 00054 REAL = 0x09, 00055 ENUMERATED = 0x0a, 00056 UTF8_STRING = 0x0c, 00057 SEQUENCE = 0x10, 00058 SET = 0x11, 00059 NUMERIC_STRING = 0x12, 00060 PRINTABLE_STRING = 0x13, 00061 T61_STRING = 0x14, 00062 VIDEOTEXT_STRING = 0x15, 00063 IA5_STRING = 0x16, 00064 UTC_TIME = 0x17, 00065 GENERALIZED_TIME = 0x18, 00066 GRAPHIC_STRING = 0x19, 00067 VISIBLE_STRING = 0x1a, 00068 GENERAL_STRING = 0x1b, 00069 LONG_LENGTH = 0x80 00070 };
| enum TaoCrypt::ASNIdFlag |
Definition at line 72 of file asn.hpp.
00073 { 00074 UNIVERSAL = 0x00, 00075 DATA = 0x01, 00076 HEADER = 0x02, 00077 CONSTRUCTED = 0x20, 00078 APPLICATION = 0x40, 00079 CONTEXT_SPECIFIC = 0x80, 00080 PRIVATE = 0xc0 00081 };
| enum TaoCrypt::DNTags |
Definition at line 84 of file asn.hpp.
00085 { 00086 COMMON_NAME = 0x03, // CN 00087 SUR_NAME = 0x04, // SN 00088 COUNTRY_NAME = 0x06, // C 00089 LOCALITY_NAME = 0x07, // L 00090 STATE_NAME = 0x08, // ST 00091 ORG_NAME = 0x0a, // O 00092 ORGUNIT_NAME = 0x0b // OU 00093 };
| enum TaoCrypt::Constants |
| MIN_DATE_SZ | |
| MAX_DATE_SZ | |
| MAX_ALGO_SZ | |
| MAX_LENGTH_SZ | |
| MAX_SEQ_SZ | |
| MAX_ALGO_SIZE | |
| MAX_DIGEST_SZ | |
| DSA_SIG_SZ | |
| ASN_NAME_MAX |
Definition at line 96 of file asn.hpp.
00097 { 00098 MIN_DATE_SZ = 13, 00099 MAX_DATE_SZ = 16, 00100 MAX_ALGO_SZ = 16, 00101 MAX_LENGTH_SZ = 5, 00102 MAX_SEQ_SZ = 5, // enum(seq|con) + length(4) 00103 MAX_ALGO_SIZE = 9, 00104 MAX_DIGEST_SZ = 25, // SHA + enum(Bit or Octet) + length(4) 00105 DSA_SIG_SZ = 40, 00106 ASN_NAME_MAX = 512 // max total of all included names 00107 };
| enum TaoCrypt::SigType |
| enum TaoCrypt::HashType |
| enum TaoCrypt::KeyType |
| anonymous enum |
| anonymous enum |
Definition at line 38 of file error.hpp.
00038 { 00039 00040 NO_ERROR = 0, // "not in error state" 00041 00042 // RandomNumberGenerator 00043 WINCRYPT_E = 1001, // "bad wincrypt acquire" 00044 CRYPTGEN_E = 1002, // "CryptGenRandom error" 00045 OPEN_RAN_E = 1003, // "open /dev/urandom error" 00046 READ_RAN_E = 1004, // "read /dev/urandom error" 00047 00048 // Integer 00049 INTEGER_E = 1010, // "bad DER Integer Header" 00050 00051 00052 // ASN.1 00053 SEQUENCE_E = 1020, // "bad Sequence Header" 00054 SET_E = 1021, // "bad Set Header" 00055 VERSION_E = 1022, // "version length not 1" 00056 SIG_OID_E = 1023, // "signature OID mismatch" 00057 BIT_STR_E = 1024, // "bad BitString Header" 00058 UNKNOWN_OID_E = 1025, // "unknown key OID type" 00059 OBJECT_ID_E = 1026, // "bad Ojbect ID Header" 00060 TAG_NULL_E = 1027, // "expected TAG NULL" 00061 EXPECT_0_E = 1028, // "expected 0" 00062 OCTET_STR_E = 1029, // "bad Octet String Header" 00063 TIME_E = 1030, // "bad TIME" 00064 00065 DATE_SZ_E = 1031, // "bad Date Size" 00066 SIG_LEN_E = 1032, // "bad Signature Length" 00067 UNKOWN_SIG_E = 1033, // "unknown signature OID" 00068 UNKOWN_HASH_E = 1034, // "unknown hash OID" 00069 DSA_SZ_E = 1035, // "bad DSA r or s size" 00070 BEFORE_DATE_E = 1036, // "before date in the future" 00071 AFTER_DATE_E = 1037, // "after date in the past" 00072 SIG_CONFIRM_E = 1038, // "bad self signature confirmation" 00073 SIG_OTHER_E = 1039 // "bad other signature confirmation" 00074 00075 };
| enum TaoCrypt::ByteOrder |
| enum TaoCrypt::CipherDir |
| enum TaoCrypt::Mode |
| anonymous enum |
| word32 TaoCrypt::GetLength | ( | Source & | ) |
Definition at line 143 of file asn.cpp.
References LONG_LENGTH, and TaoCrypt::Source::next().
Referenced by TaoCrypt::CertDecoder::AddDSA(), TaoCrypt::Integer::Decode(), DecodeDSA_Signature(), TaoCrypt::CertDecoder::GetAlgoId(), TaoCrypt::CertDecoder::GetDate(), TaoCrypt::CertDecoder::GetDigest(), TaoCrypt::CertDecoder::GetName(), TaoCrypt::BER_Decoder::GetSequence(), TaoCrypt::BER_Decoder::GetSet(), and TaoCrypt::CertDecoder::GetSignature().
00144 { 00145 word32 length = 0; 00146 00147 byte b = source.next(); 00148 if (b >= LONG_LENGTH) { 00149 word32 bytes = b & 0x7F; 00150 00151 while (bytes--) { 00152 b = source.next(); 00153 length = (length << 8) | b; 00154 } 00155 } 00156 else 00157 length = b; 00158 00159 return length; 00160 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 163 of file asn.cpp.
References BytePrecision(), and LONG_LENGTH.
Referenced by EncodeDSA_Signature(), TaoCrypt::DER_Encoder::SetAlgoID(), and SetSequence().
00164 { 00165 word32 i = 0; 00166 00167 if (length < LONG_LENGTH) 00168 output[i++] = length; 00169 else { 00170 output[i++] = BytePrecision(length) | 0x80; 00171 00172 for (int j = BytePrecision(length); j; --j) { 00173 output[i] = length >> (j - 1) * 8; 00174 i++; 00175 } 00176 } 00177 return i; 00178 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 992 of file asn.cpp.
References CONSTRUCTED, SEQUENCE, and SetLength().
Referenced by EncodeDSA_Signature(), TaoCrypt::DER_Encoder::SetAlgoID(), and TaoCrypt::Signature_Encoder::Signature_Encoder().
00993 { 00994 00995 output[0] = SEQUENCE | CONSTRUCTED; 00996 return SetLength(len, output + 1) + 1; 00997 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1000 of file asn.cpp.
Referenced by yaSSL::CertificateVerify::Build(), and yaSSL::DH_Server::build().
01001 { 01002 Integer r(signature, 20); 01003 Integer s(signature + 20, 20); 01004 01005 return EncodeDSA_Signature(r, s, output); 01006 }
Here is the caller graph for this function:

Definition at line 1009 of file asn.cpp.
References TaoCrypt::Integer::ByteCount(), TaoCrypt::Integer::Encode(), INTEGER, MAX_LENGTH_SZ, MAX_SEQ_SZ, memcpy, SetLength(), and SetSequence().
01010 { 01011 word32 rSz = r.ByteCount(); 01012 word32 sSz = s.ByteCount(); 01013 01014 byte rLen[MAX_LENGTH_SZ + 1]; 01015 byte sLen[MAX_LENGTH_SZ + 1]; 01016 01017 rLen[0] = INTEGER; 01018 sLen[0] = INTEGER; 01019 01020 word32 rLenSz = SetLength(rSz, &rLen[1]) + 1; 01021 word32 sLenSz = SetLength(sSz, &sLen[1]) + 1; 01022 01023 byte seqArray[MAX_SEQ_SZ]; 01024 01025 word32 seqSz = SetSequence(rLenSz + rSz + sLenSz + sSz, seqArray); 01026 01027 // seq 01028 memcpy(output, seqArray, seqSz); 01029 // r 01030 memcpy(output + seqSz, rLen, rLenSz); 01031 r.Encode(output + seqSz + rLenSz, rSz); 01032 // s 01033 memcpy(output + seqSz + rLenSz + rSz, sLen, sLenSz); 01034 s.Encode(output + seqSz + rLenSz + rSz + sLenSz, sSz); 01035 01036 return seqSz + rLenSz + rSz + sLenSz + sSz; 01037 }
Here is the call graph for this function:

Definition at line 1041 of file asn.cpp.
References TaoCrypt::Source::advance(), CONSTRUCTED, DSA_SZ_E, TaoCrypt::Source::get_buffer(), TaoCrypt::Source::get_index(), GetLength(), INTEGER, INTEGER_E, memcpy, TaoCrypt::Source::next(), SEQUENCE, SEQUENCE_E, and TaoCrypt::Source::SetError().
Referenced by TaoCrypt::CertDecoder::ConfirmSignature(), yaSSL::CertificateVerify::Process(), and yaSSL::DH_Server::read().
01042 { 01043 Source source(encoded, sz); 01044 01045 if (source.next() != (SEQUENCE | CONSTRUCTED)) { 01046 source.SetError(SEQUENCE_E); 01047 return 0; 01048 } 01049 01050 GetLength(source); // total 01051 01052 // r 01053 if (source.next() != INTEGER) { 01054 source.SetError(INTEGER_E); 01055 return 0; 01056 } 01057 word32 rLen = GetLength(source); 01058 if (rLen != 20) 01059 if (rLen == 21) { // zero at front, eat 01060 source.next(); 01061 --rLen; 01062 } 01063 else if (rLen == 19) { // add zero to front so 20 bytes 01064 decoded[0] = 0; 01065 decoded++; 01066 } 01067 else { 01068 source.SetError(DSA_SZ_E); 01069 return 0; 01070 } 01071 memcpy(decoded, source.get_buffer() + source.get_index(), rLen); 01072 source.advance(rLen); 01073 01074 // s 01075 if (source.next() != INTEGER) { 01076 source.SetError(INTEGER_E); 01077 return 0; 01078 } 01079 word32 sLen = GetLength(source); 01080 if (sLen != 20) 01081 if (sLen == 21) { 01082 source.next(); // zero at front, eat 01083 --sLen; 01084 } 01085 else if (sLen == 19) { 01086 decoded[rLen] = 0; // add zero to front so 20 bytes 01087 decoded++; 01088 } 01089 else { 01090 source.SetError(DSA_SZ_E); 01091 return 0; 01092 } 01093 memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen); 01094 source.advance(sLen); 01095 01096 return 40; 01097 }
Here is the call graph for this function:

Here is the caller graph for this function:

| A::pointer TaoCrypt::StdReallocate | ( | A & | a, | |
| T * | p, | |||
| typename A::size_type | oldSize, | |||
| typename A::size_type | newSize, | |||
| bool | preserve | |||
| ) |
Definition at line 72 of file block.hpp.
References memcpy, min(), and mySTL::swap().
Referenced by TaoCrypt::AllocatorWithCleanup< T >::reallocate().
00074 { 00075 if (oldSize == newSize) 00076 return p; 00077 00078 if (preserve) { 00079 A b = A(); 00080 typename A::pointer newPointer = b.allocate(newSize, 0); 00081 memcpy(newPointer, p, sizeof(T) * min(oldSize, newSize)); 00082 a.deallocate(p, oldSize); 00083 mySTL::swap(a, b); 00084 return newPointer; 00085 } 00086 else { 00087 a.deallocate(p, oldSize); 00088 return a.allocate(newSize, 0); 00089 } 00090 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const T& TaoCrypt::min | ( | const T & | a, | |
| const T & | b | |||
| ) | [inline] |
Definition at line 118 of file integer.hpp.
Referenced by TaoCrypt::Integer::Integer(), TaoCrypt::Integer::Randomize(), ShiftWordsLeftByWords(), ShiftWordsRightByWords(), StdReallocate(), TaoCrypt::SHA::Update(), TaoCrypt::RIPEMD160::Update(), TaoCrypt::MD5::Update(), and TaoCrypt::HASHwithTransform::Update().
Here is the caller graph for this function:

| const T& TaoCrypt::max | ( | const T & | a, | |
| const T & | b | |||
| ) | [inline] |
Definition at line 126 of file integer.hpp.
Referenced by TaoCrypt::AbstractGroup::CascadeScalarMultiply(), TaoCrypt::Integer::Encode(), TaoCrypt::Integer::Integer(), TaoCrypt::Integer::MinEncodedSize(), TaoCrypt::Integer::Minus(), TaoCrypt::Integer::Plus(), and TaoCrypt::Integer::Randomize().
Here is the caller graph for this function:

| bool TaoCrypt::operator== | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 283 of file integer.hpp.
References TaoCrypt::Integer::Compare().
Here is the call graph for this function:

| bool TaoCrypt::operator!= | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 285 of file integer.hpp.
References TaoCrypt::Integer::Compare().
Here is the call graph for this function:

| bool TaoCrypt::operator> | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 287 of file integer.hpp.
References TaoCrypt::Integer::Compare().
Here is the call graph for this function:

| bool TaoCrypt::operator>= | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 289 of file integer.hpp.
References TaoCrypt::Integer::Compare().
Here is the call graph for this function:

| bool TaoCrypt::operator< | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 291 of file integer.hpp.
References TaoCrypt::Integer::Compare().
Here is the call graph for this function:

| bool TaoCrypt::operator<= | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 293 of file integer.hpp.
References TaoCrypt::Integer::Compare().
Here is the call graph for this function:

| Integer TaoCrypt::operator+ | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 296 of file integer.hpp.
References TaoCrypt::Integer::Plus().
Here is the call graph for this function:

| Integer TaoCrypt::operator- | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 298 of file integer.hpp.
References TaoCrypt::Integer::Minus().
Here is the call graph for this function:

| Integer TaoCrypt::operator * | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 300 of file integer.hpp.
References TaoCrypt::Integer::Times().
Here is the call graph for this function:

| Integer TaoCrypt::operator/ | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 302 of file integer.hpp.
References TaoCrypt::Integer::DividedBy().
Here is the call graph for this function:

| Integer TaoCrypt::operator% | ( | const Integer & | a, | |
| const Integer & | b | |||
| ) | [inline] |
Definition at line 304 of file integer.hpp.
References TaoCrypt::Integer::Modulo().
Here is the call graph for this function:

Definition at line 306 of file integer.hpp.
References TaoCrypt::Integer::DividedBy().
Here is the call graph for this function:

Definition at line 307 of file integer.hpp.
References TaoCrypt::Integer::Modulo().
Here is the call graph for this function:

| void TaoCrypt::swap | ( | Integer & | a, | |
| Integer & | b | |||
| ) | [inline] |
Definition at line 309 of file integer.hpp.
References TaoCrypt::Integer::Swap().
Here is the call graph for this function:

| Integer TaoCrypt::CRT | ( | const Integer & | xp, | |
| const Integer & | p, | |||
| const Integer & | xq, | |||
| const Integer & | q, | |||
| const Integer & | u | |||
| ) |
Definition at line 3974 of file integer.cpp.
References p.
Referenced by ModularRoot().
03976 { 03977 // isn't operator overloading great? 03978 return p * (u * (xq-xp) % q) + xp; 03979 }
Here is the caller graph for this function:

| Integer TaoCrypt::ModularExponentiation | ( | const Integer & | a, | |
| const Integer & | e, | |||
| const Integer & | m | |||
| ) | [inline] |
Definition at line 318 of file integer.hpp.
References a_exp_b_mod_c(), and e.
Referenced by ModularRoot().
00320 { 00321 return a_exp_b_mod_c(a, e, m); 00322 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Integer TaoCrypt::ModularRoot | ( | const Integer & | a, | |
| const Integer & | dp, | |||
| const Integer & | dq, | |||
| const Integer & | p, | |||
| const Integer & | q, | |||
| const Integer & | u | |||
| ) |
Definition at line 3966 of file integer.cpp.
References CRT(), ModularExponentiation(), and p.
Referenced by TaoCrypt::RSA_PrivateKey::CalculateInverse().
03968 { 03969 Integer p2 = ModularExponentiation((a % p), dp, p); 03970 Integer q2 = ModularExponentiation((a % q), dq, q); 03971 return CRT(p2, p, q2, q, u); 03972 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::swap | ( | MD2 & | a, | |
| MD2 & | b | |||
| ) | [inline] |
Definition at line 62 of file md2.hpp.
References TaoCrypt::MD2::Swap().
Here is the call graph for this function:

| void TaoCrypt::swap | ( | MD4 & | a, | |
| MD4 & | b | |||
| ) | [inline] |
Definition at line 60 of file md4.hpp.
References TaoCrypt::MD4::Swap().
Here is the call graph for this function:

| void TaoCrypt::swap | ( | MD5 & | a, | |
| MD5 & | b | |||
| ) | [inline] |
Definition at line 61 of file md5.hpp.
References TaoCrypt::MD5::Swap().
Here is the call graph for this function:

| void TaoCrypt::CleanUp | ( | ) |
Definition at line 2738 of file integer.cpp.
References one, tcDelete(), and zero.
Referenced by yaSSL_CleanUp().
02739 { 02740 tcDelete(one); 02741 tcDelete(zero); 02742 02743 // In case user calls more than once, prevent seg fault 02744 one = 0; 02745 zero = 0; 02746 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::tcDelete | ( | T * | ptr | ) |
Definition at line 102 of file misc.hpp.
Referenced by CleanUp(), and TaoCrypt::CertDecoder::ConfirmSignature().
Here is the caller graph for this function:

| void TaoCrypt::tcArrayDelete | ( | T * | ptr | ) |
Definition at line 108 of file misc.hpp.
Referenced by TaoCrypt::PublicKey::AddToEnd(), TaoCrypt::AllocatorWithCleanup< T >::deallocate(), TaoCrypt::CertDecoder::~CertDecoder(), and TaoCrypt::PublicKey::~PublicKey().
Here is the caller graph for this function:

| unsigned int TaoCrypt::BitsToBytes | ( | unsigned int | bitCount | ) | [inline] |
Definition at line 275 of file misc.hpp.
Referenced by TaoCrypt::PK_Lengths::PaddedBlockByteLength(), and SSL_Decrypt().
Here is the caller graph for this function:

| unsigned int TaoCrypt::BytesToWords | ( | unsigned int | byteCount | ) | [inline] |
Definition at line 280 of file misc.hpp.
References WORD_SIZE.
Referenced by TaoCrypt::Integer::Decode(), and TaoCrypt::Integer::SetByte().
Here is the caller graph for this function:

| unsigned int TaoCrypt::BitsToWords | ( | unsigned int | bitCount | ) | [inline] |
Definition at line 285 of file misc.hpp.
References WORD_BITS.
Referenced by TaoCrypt::Integer::DivideByPowerOf2(), TaoCrypt::Integer::operator<<=(), TaoCrypt::Integer::Power2(), and TaoCrypt::Integer::SetBit().
Here is the caller graph for this function:

Definition at line 290 of file misc.hpp.
Referenced by AlmostInverse(), AsymmetricMultiply(), TaoCrypt::MontgomeryRepresentation::ConvertOut(), Divide(), DivideByPower2Mod(), TaoCrypt::Integer::DivideByPowerOf2(), TaoCrypt::Integer::Integer(), TaoCrypt::ModularArithmetic::Inverse(), MontgomeryReduce(), TaoCrypt::MontgomeryRepresentation::MultiplicativeInverse(), MultiplyByPower2Mod(), TaoCrypt::Integer::operator=(), PositiveAdd(), PositiveSubtract(), and RecursiveMultiplyTop().
Here is the caller graph for this function:

| unsigned int TaoCrypt::CountWords | ( | const word * | X, | |
| unsigned int | N | |||
| ) | [inline] |
Definition at line 296 of file misc.hpp.
Referenced by TaoCrypt::Integer::WordCount().
Here is the caller graph for this function:

Definition at line 303 of file misc.hpp.
Referenced by AlmostInverse(), AsymmetricMultiply(), TaoCrypt::MontgomeryRepresentation::ConvertOut(), TaoCrypt::Integer::DivideByPowerOf2(), TaoCrypt::Integer::Integer(), TaoCrypt::MontgomeryRepresentation::MultiplicativeInverse(), TaoCrypt::MontgomeryRepresentation::Multiply(), RecursiveInverseModPower2(), RecursiveMultiply(), RecursiveMultiplyTop(), ShiftWordsLeftByWords(), ShiftWordsRightByWords(), and TaoCrypt::MontgomeryRepresentation::Square().
00304 { 00305 for (unsigned int i=0; i<n; i++) 00306 r[i] = a; 00307 }
Here is the caller graph for this function:

Definition at line 312 of file misc.hpp.
References DECRYPTION, and ENCRYPTION.
Referenced by TaoCrypt::DES_EDE3::SetKey(), and TaoCrypt::DES_EDE2::SetKey().
00313 { 00314 return (dir == ENCRYPTION) ? DECRYPTION : ENCRYPTION; 00315 }
Here is the caller graph for this function:

| ByteOrder TaoCrypt::GetHostByteOrder | ( | ) | [inline] |
Definition at line 333 of file misc.hpp.
References TaoCrypt::EnumToType< ENUM_TYPE, VALUE >::ToEnum().
Referenced by HostByteOrderIs().
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 338 of file misc.hpp.
References GetHostByteOrder().
Referenced by ByteReverseIf().
00339 { 00340 return order == GetHostByteOrder(); 00341 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 114 of file misc.cpp.
References WORD_SIZE, and XorWords().
Referenced by TaoCrypt::Mode_BASE::CBC_Decrypt(), TaoCrypt::Mode_BASE::CBC_Encrypt(), and TaoCrypt::PBKDF2_HMAC< T >::DeriveKey().
00115 { 00116 if (((size_t)buf | (size_t)mask | count) % WORD_SIZE == 0) 00117 XorWords((word *)buf, (const word *)mask, count/WORD_SIZE); 00118 else 00119 { 00120 for (unsigned int i=0; i<count; i++) 00121 buf[i] ^= mask[i]; 00122 } 00123 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool TaoCrypt::IsPowerOf2 | ( | T | n | ) | [inline] |
Definition at line 348 of file misc.hpp.
Referenced by IsAlignedOn(), ModPowerOf2(), and RoundDownToMultipleOf().
Here is the caller graph for this function:

Definition at line 354 of file misc.hpp.
References assert, IsPowerOf2(), and T2.
Referenced by IsAlignedOn(), and RoundDownToMultipleOf().
00355 { 00356 assert(IsPowerOf2(b)); 00357 return T2(a) & (b-1); 00358 }
Here is the call graph for this function:

Here is the caller graph for this function:

| T TaoCrypt::RoundDownToMultipleOf | ( | T | n, | |
| T | m | |||
| ) | [inline] |
Definition at line 361 of file misc.hpp.
References IsPowerOf2(), and ModPowerOf2().
Referenced by RoundUpToMultipleOf().
00362 { 00363 return n - (IsPowerOf2(m) ? ModPowerOf2(n, m) : (n%m)); 00364 }
Here is the call graph for this function:

Here is the caller graph for this function:

| T TaoCrypt::RoundUpToMultipleOf | ( | T | n, | |
| T | m | |||
| ) | [inline] |
Definition at line 367 of file misc.hpp.
References RoundDownToMultipleOf().
Referenced by GetUserKey().
00368 { 00369 return RoundDownToMultipleOf(n+m-1, m); 00370 }
Here is the call graph for this function:

Here is the caller graph for this function:

| unsigned int TaoCrypt::GetAlignment | ( | T * | dummy = 0 |
) | [inline] |
| bool TaoCrypt::IsAlignedOn | ( | const void * | p, | |
| unsigned int | alignment | |||
| ) | [inline] |
Definition at line 384 of file misc.hpp.
References IsPowerOf2(), and ModPowerOf2().
Referenced by IsAligned().
00385 { 00386 return IsPowerOf2(alignment) ? ModPowerOf2((size_t)p, alignment) == 0 00387 : (size_t)p % alignment == 0; 00388 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool TaoCrypt::IsAligned | ( | const void * | p, | |
| T * | dummy = 0 | |||
| ) | [inline] |
Definition at line 391 of file misc.hpp.
References IsAlignedOn().
00392 { 00393 return IsAlignedOn(p, GetAlignment<T>()); 00394 }
Here is the call graph for this function:

| T TaoCrypt::rotlFixed | ( | T | x, | |
| unsigned int | y | |||
| ) | [inline] |
Definition at line 397 of file misc.hpp.
References assert.
Referenced by ByteReverse(), FPERM(), IPERM(), and TaoCrypt::Twofish::SetKey().
Here is the caller graph for this function:

| T TaoCrypt::rotrFixed | ( | T | x, | |
| unsigned int | y | |||
| ) | [inline] |
Definition at line 403 of file misc.hpp.
References assert.
Referenced by ByteReverse(), FPERM(), IPERM(), and TaoCrypt::BasicDES::RawProcessBlock().
Here is the caller graph for this function:

Definition at line 437 of file misc.hpp.
References rotlFixed(), and rotrFixed().
Referenced by ByteReverse(), and ByteReverseIf().
00438 { 00439 #ifdef PPC_INTRINSICS 00440 // PPC: load reverse indexed instruction 00441 return (word32)__lwbrx(&value,0); 00442 #elif defined(FAST_ROTATE) 00443 // 5 instructions with rotate instruction, 9 without 00444 return (rotrFixed(value, 8U) & 0xff00ff00) | 00445 (rotlFixed(value, 8U) & 0x00ff00ff); 00446 #else 00447 // 6 instructions with rotate instruction, 8 without 00448 value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8); 00449 return rotlFixed(value, 16U); 00450 #endif 00451 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::ByteReverse | ( | T * | out, | |
| const T * | in, | |||
| word32 | byteCount | |||
| ) | [inline] |
Definition at line 455 of file misc.hpp.
References assert, ByteReverse(), and count.
00456 { 00457 assert(byteCount % sizeof(T) == 0); 00458 word32 count = byteCount/sizeof(T); 00459 for (word32 i=0; i<count; i++) 00460 out[i] = ByteReverse(in[i]); 00461 }
Here is the call graph for this function:

Definition at line 463 of file misc.hpp.
References ByteReverse().
00464 { 00465 word32* o = reinterpret_cast<word32*>(out); 00466 const word32* i = reinterpret_cast<const word32*>(in); 00467 ByteReverse(o, i, byteCount); 00468 }
Here is the call graph for this function:

| T TaoCrypt::ByteReverseIf | ( | T | value, | |
| ByteOrder | order | |||
| ) | [inline] |
Definition at line 472 of file misc.hpp.
References ByteReverse(), and HostByteOrderIs().
Referenced by TaoCrypt::HASHwithTransform::Final(), GetUserKey(), GetWord(), PutWord(), TaoCrypt::SHA::Update(), TaoCrypt::RIPEMD160::Update(), TaoCrypt::MD5::Update(), and TaoCrypt::HASHwithTransform::Update().
00473 { 00474 return HostByteOrderIs(order) ? value : ByteReverse(value); 00475 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::ByteReverseIf | ( | T * | out, | |
| const T * | in, | |||
| word32 | bc, | |||
| ByteOrder | order | |||
| ) | [inline] |
Definition at line 479 of file misc.hpp.
References ByteReverse(), HostByteOrderIs(), and memcpy.
00480 { 00481 if (!HostByteOrderIs(order)) 00482 ByteReverse(out, in, bc); 00483 else if (out != in) 00484 memcpy(out, in, bc); 00485 }
Here is the call graph for this function:

| void TaoCrypt::GetUserKey | ( | ByteOrder | order, | |
| T * | out, | |||
| word32 | outlen, | |||
| const byte * | in, | |||
| word32 | inlen | |||
| ) | [inline] |
Definition at line 541 of file misc.hpp.
References assert, ByteReverseIf(), memcpy, memset, and RoundUpToMultipleOf().
Referenced by TaoCrypt::Twofish::SetKey(), and TaoCrypt::AES::SetKey().
00543 { 00544 const unsigned int U = sizeof(T); 00545 assert(inlen <= outlen*U); 00546 memcpy(out, in, inlen); 00547 memset((byte *)out+inlen, 0, outlen*U-inlen); 00548 ByteReverseIf(out, out, RoundUpToMultipleOf(inlen, U), order); 00549 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 558 of file misc.hpp.
Referenced by UnalignedGetWord().
00560 { 00561 return block[0]; 00562 }
Here is the caller graph for this function:

| word16 TaoCrypt::UnalignedGetWordNonTemplate | ( | ByteOrder | order, | |
| const byte * | block, | |||
| word16 * | ||||
| ) | [inline] |
Definition at line 564 of file misc.hpp.
References BigEndianOrder.
00566 { 00567 return (order == BigEndianOrder) 00568 ? block[1] | (block[0] << 8) 00569 : block[0] | (block[1] << 8); 00570 }
| word32 TaoCrypt::UnalignedGetWordNonTemplate | ( | ByteOrder | order, | |
| const byte * | block, | |||
| word32 * | ||||
| ) | [inline] |
Definition at line 572 of file misc.hpp.
References BigEndianOrder.
00574 { 00575 return (order == BigEndianOrder) 00576 ? word32(block[3]) | (word32(block[2]) << 8) | (word32(block[1]) << 16) 00577 | (word32(block[0]) << 24) 00578 : word32(block[0]) | (word32(block[1]) << 8) | (word32(block[2]) << 16) 00579 | (word32(block[3]) << 24); 00580 }
| T TaoCrypt::UnalignedGetWord | ( | ByteOrder | order, | |
| const byte * | block, | |||
| T * | dummy = 0 | |||
| ) | [inline] |
Definition at line 583 of file misc.hpp.
References UnalignedGetWordNonTemplate().
00584 { 00585 return UnalignedGetWordNonTemplate(order, block, dummy); 00586 }
Here is the call graph for this function:

| void TaoCrypt::UnalignedPutWord | ( | ByteOrder | order, | |
| byte * | block, | |||
| word16 | value, | |||
| const byte * | xorBlock = 0 | |||
| ) | [inline] |
Definition at line 596 of file misc.hpp.
References BigEndianOrder, and GETBYTE.
00598 { 00599 if (order == BigEndianOrder) 00600 { 00601 block[0] = GETBYTE(value, 1); 00602 block[1] = GETBYTE(value, 0); 00603 } 00604 else 00605 { 00606 block[0] = GETBYTE(value, 0); 00607 block[1] = GETBYTE(value, 1); 00608 } 00609 00610 if (xorBlock) 00611 { 00612 block[0] ^= xorBlock[0]; 00613 block[1] ^= xorBlock[1]; 00614 } 00615 }
| void TaoCrypt::UnalignedPutWord | ( | ByteOrder | order, | |
| byte * | block, | |||
| word32 | value, | |||
| const byte * | xorBlock = 0 | |||
| ) | [inline] |
Definition at line 617 of file misc.hpp.
References BigEndianOrder, and GETBYTE.
00619 { 00620 if (order == BigEndianOrder) 00621 { 00622 block[0] = GETBYTE(value, 3); 00623 block[1] = GETBYTE(value, 2); 00624 block[2] = GETBYTE(value, 1); 00625 block[3] = GETBYTE(value, 0); 00626 } 00627 else 00628 { 00629 block[0] = GETBYTE(value, 0); 00630 block[1] = GETBYTE(value, 1); 00631 block[2] = GETBYTE(value, 2); 00632 block[3] = GETBYTE(value, 3); 00633 } 00634 00635 if (xorBlock) 00636 { 00637 block[0] ^= xorBlock[0]; 00638 block[1] ^= xorBlock[1]; 00639 block[2] ^= xorBlock[2]; 00640 block[3] ^= xorBlock[3]; 00641 } 00642 }
| T TaoCrypt::GetWord | ( | bool | assumeAligned, | |
| ByteOrder | order, | |||
| const byte * | block | |||
| ) | [inline] |
Definition at line 646 of file misc.hpp.
References assert, and ByteReverseIf().
00647 { 00648 if (assumeAligned) 00649 { 00650 assert(IsAligned<T>(block)); 00651 return ByteReverseIf(*reinterpret_cast<const T *>(block), order); 00652 } 00653 else 00654 return UnalignedGetWord<T>(order, block); 00655 }
Here is the call graph for this function:

| void TaoCrypt::PutWord | ( | bool | assumeAligned, | |
| ByteOrder | order, | |||
| byte * | block, | |||
| T | value, | |||
| const byte * | xorBlock = 0 | |||
| ) | [inline] |
Definition at line 665 of file misc.hpp.
References assert, ByteReverseIf(), and UnalignedPutWord().
Referenced by TaoCrypt::PutBlock< T, B, A >::operator()().
00667 { 00668 if (assumeAligned) 00669 { 00670 assert(IsAligned<T>(block)); 00671 if (xorBlock) 00672 *reinterpret_cast<T *>(block) = ByteReverseIf(value, order) 00673 ^ *reinterpret_cast<const T *>(xorBlock); 00674 else 00675 *reinterpret_cast<T *>(block) = ByteReverseIf(value, order); 00676 } 00677 else 00678 UnalignedPutWord(order, block, value, xorBlock); 00679 }
Here is the call graph for this function:

Here is the caller graph for this function:

| T TaoCrypt::SafeRightShift | ( | T | value | ) | [inline] |
| T TaoCrypt::SafeLeftShift | ( | T | value | ) | [inline] |
Definition at line 781 of file misc.hpp.
References assert, and WORD_BITS.
Referenced by AlmostInverse(), Divide(), MultiplyByPower2Mod(), and TaoCrypt::Integer::operator<<=().
00782 { 00783 assert (shiftBits<WORD_BITS); 00784 word u, carry=0; 00785 if (shiftBits) 00786 for (unsigned int i=0; i<n; i++) 00787 { 00788 u = r[i]; 00789 r[i] = (u << shiftBits) | carry; 00790 carry = u >> (WORD_BITS-shiftBits); 00791 } 00792 return carry; 00793 }
Here is the caller graph for this function:

Definition at line 797 of file misc.hpp.
References assert, and WORD_BITS.
Referenced by AlmostInverse(), Divide(), DivideByPower2Mod(), and TaoCrypt::Integer::operator>>=().
00798 { 00799 assert (shiftBits<WORD_BITS); 00800 word u, carry=0; 00801 if (shiftBits) 00802 for (int i=n-1; i>=0; i--) 00803 { 00804 u = r[i]; 00805 r[i] = (u >> shiftBits) | carry; 00806 carry = u << (WORD_BITS-shiftBits); 00807 } 00808 return carry; 00809 }
Here is the caller graph for this function:

| void TaoCrypt::ShiftWordsLeftByWords | ( | word * | r, | |
| unsigned int | n, | |||
| unsigned int | shiftWords | |||
| ) | [inline] |
Definition at line 813 of file misc.hpp.
References min(), and SetWords().
Referenced by AlmostInverse(), and TaoCrypt::Integer::operator<<=().
00814 { 00815 shiftWords = min(shiftWords, n); 00816 if (shiftWords) 00817 { 00818 for (unsigned int i=n-1; i>=shiftWords; i--) 00819 r[i] = r[i-shiftWords]; 00820 SetWords(r, 0, shiftWords); 00821 } 00822 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::ShiftWordsRightByWords | ( | word * | r, | |
| unsigned int | n, | |||
| unsigned int | shiftWords | |||
| ) | [inline] |
Definition at line 826 of file misc.hpp.
References min(), and SetWords().
Referenced by AlmostInverse(), and TaoCrypt::Integer::operator>>=().
00827 { 00828 shiftWords = min(shiftWords, n); 00829 if (shiftWords) 00830 { 00831 for (unsigned int i=0; i+shiftWords<n; i++) 00832 r[i] = r[i+shiftWords]; 00833 SetWords(r+n-shiftWords, 0, shiftWords); 00834 } 00835 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 839 of file misc.hpp.
References T1, T2, and TAOCRYPT_COMPILE_ASSERT_INSTANCE.
Referenced by TaoCrypt::PK_Lengths::FixedMaxPlaintextLength(), TaoCrypt::RSA_BlockType1::UnPad(), and TaoCrypt::RSA_BlockType2::UnPad().
00840 { 00841 TAOCRYPT_COMPILE_ASSERT_INSTANCE(T1(-1)>0, 0); // T1 is unsigned type 00842 TAOCRYPT_COMPILE_ASSERT_INSTANCE(T2(-1)>0, 1); // T2 is unsigned type 00843 return T1((a > b) ? (a - b) : 0); 00844 }
Here is the caller graph for this function:

| unsigned int TaoCrypt::BytePrecision | ( | unsigned long | value | ) |
Definition at line 126 of file misc.cpp.
Referenced by TaoCrypt::Integer::ByteCount(), and SetLength().
00127 { 00128 unsigned int i; 00129 for (i=sizeof(value); i; --i) 00130 if (value >> (i-1)*8) 00131 break; 00132 00133 return i; 00134 }
Here is the caller graph for this function:

| unsigned int TaoCrypt::BitPrecision | ( | unsigned | long | ) |
Definition at line 137 of file misc.cpp.
References h.
Referenced by TaoCrypt::Integer::BitCount(), TaoCrypt::Integer::Divide(), Divide(), and RoundupSize().
00138 { 00139 if (!value) 00140 return 0; 00141 00142 unsigned int l = 0, 00143 h = 8 * sizeof(value); 00144 00145 while (h-l > 1) 00146 { 00147 unsigned int t = (l+h)/2; 00148 if (value >> t) 00149 l = t; 00150 else 00151 h = t; 00152 } 00153 00154 return h; 00155 }
Here is the caller graph for this function:

| unsigned long TaoCrypt::Crop | ( | unsigned long | value, | |
| unsigned int | size | |||
| ) |
Definition at line 158 of file misc.cpp.
Referenced by TaoCrypt::Integer::Randomize().
00159 { 00160 if (size < 8*sizeof(value)) 00161 return (value & ((1L << size) - 1)); 00162 else 00163 return value; 00164 }
Here is the caller graph for this function:

| void TaoCrypt::swap | ( | RIPEMD160 & | a, | |
| RIPEMD160 & | b | |||
| ) | [inline] |
Definition at line 60 of file ripemd.hpp.
References TaoCrypt::RIPEMD160::Swap().
Here is the call graph for this function:

Definition at line 202 of file rsa.cpp.
References BitsToBytes(), key, lengths, x, and TaoCrypt::Integer::Zero().
Referenced by TaoCrypt::RSA_Encryptor< Pad >::SSL_Verify().
00203 { 00204 PK_Lengths lengths(key.GetModulus()); 00205 00206 ByteBlock paddedBlock(BitsToBytes(lengths.PaddedBlockBitLength())); 00207 Integer x = key.ApplyFunction(Integer(sig, 00208 lengths.FixedCiphertextLength())); 00209 if (x.ByteCount() > paddedBlock.size()) 00210 x = Integer::Zero(); 00211 x.Encode(paddedBlock.get_buffer(), paddedBlock.size()); 00212 return RSA_BlockType1().UnPad(paddedBlock.get_buffer(), 00213 lengths.PaddedBlockBitLength(), plain); 00214 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::swap | ( | SHA & | a, | |
| SHA & | b | |||
| ) | [inline] |
Definition at line 62 of file sha.hpp.
References TaoCrypt::SHA::Swap().
Here is the call graph for this function:

Definition at line 67 of file arc4.cpp.
Referenced by TaoCrypt::ARC4::Process().
00068 { 00069 word32 a = s[x]; 00070 y = (y+a) & 0xff; 00071 00072 word32 b = s[y]; 00073 s[x] = b; 00074 s[y] = a; 00075 x = (x+1) & 0xff; 00076 00077 return s[(a+b) & 0xff]; 00078 }
Here is the caller graph for this function:

| bool TaoCrypt::@40::operator> | ( | tm & | a, | |
| tm & | b | |||
| ) | [static] |
Definition at line 49 of file asn.cpp.
00050 { 00051 if (a.tm_year > b.tm_year) 00052 return true; 00053 00054 if (a.tm_year == b.tm_year && a.tm_mon > b.tm_mon) 00055 return true; 00056 00057 if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon && a.tm_mday >b.tm_mday) 00058 return true; 00059 00060 if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon && 00061 a.tm_mday == b.tm_mday && a.tm_hour > b.tm_hour) 00062 return true; 00063 00064 if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon && 00065 a.tm_mday == b.tm_mday && a.tm_hour == b.tm_hour && 00066 a.tm_min > b.tm_min) 00067 return true; 00068 00069 return false; 00070 }
| bool TaoCrypt::@40::operator< | ( | tm & | a, | |
| tm & | b | |||
| ) | [static] |
Definition at line 80 of file asn.cpp.
Referenced by GetTime(), and ValidateDate().
Here is the caller graph for this function:

| void TaoCrypt::@40::GetTime | ( | int & | value, | |
| const byte * | date, | |||
| int & | i | |||
| ) | [static] |
| bool TaoCrypt::@40::ValidateDate | ( | const byte * | date, | |
| byte | format, | |||
| CertDecoder::DateType | dt | |||
| ) | [static] |
Definition at line 95 of file asn.cpp.
References assert, TaoCrypt::CertDecoder::BEFORE, btoi(), GetTime(), memset, and UTC_TIME.
Referenced by TaoCrypt::CertDecoder::GetDate().
00096 { 00097 tm certTime; 00098 memset(&certTime, 0, sizeof(certTime)); 00099 int i = 0; 00100 00101 if (format == UTC_TIME) { 00102 if (btoi(date[0]) >= 5) 00103 certTime.tm_year = 1900; 00104 else 00105 certTime.tm_year = 2000; 00106 } 00107 else { // format == GENERALIZED_TIME 00108 certTime.tm_year += btoi(date[i++]) * 1000; 00109 certTime.tm_year += btoi(date[i++]) * 100; 00110 } 00111 00112 GetTime(certTime.tm_year, date, i); certTime.tm_year -= 1900; // adjust 00113 GetTime(certTime.tm_mon, date, i); certTime.tm_mon -= 1; // adjust 00114 GetTime(certTime.tm_mday, date, i); 00115 GetTime(certTime.tm_hour, date, i); 00116 GetTime(certTime.tm_min, date, i); 00117 GetTime(certTime.tm_sec, date, i); 00118 00119 assert(date[i] == 'Z'); // only Zulu supported for this profile 00120 00121 time_t ltime = time(0); 00122 tm* localTime = gmtime(<ime); 00123 00124 if (dt == CertDecoder::BEFORE) { 00125 if (*localTime < certTime) 00126 return false; 00127 } 00128 else 00129 if (*localTime > certTime) 00130 return false; 00131 00132 return true; 00133 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 274 of file des.cpp.
References rotlFixed(), and rotrFixed().
Referenced by TaoCrypt::DES_EDE3::ProcessAndXorBlock(), TaoCrypt::DES_EDE2::ProcessAndXorBlock(), and TaoCrypt::DES::ProcessAndXorBlock().
00275 { 00276 word32 work; 00277 00278 right = rotlFixed(right, 4U); 00279 work = (left ^ right) & 0xf0f0f0f0; 00280 left ^= work; 00281 00282 right = rotrFixed(right^work, 20U); 00283 work = (left ^ right) & 0xffff0000; 00284 left ^= work; 00285 00286 right = rotrFixed(right^work, 18U); 00287 work = (left ^ right) & 0x33333333; 00288 left ^= work; 00289 00290 right = rotrFixed(right^work, 6U); 00291 work = (left ^ right) & 0x00ff00ff; 00292 left ^= work; 00293 00294 right = rotlFixed(right^work, 9U); 00295 work = (left ^ right) & 0xaaaaaaaa; 00296 left = rotlFixed(left^work, 1U); 00297 right ^= work; 00298 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 300 of file des.cpp.
References rotlFixed(), and rotrFixed().
Referenced by TaoCrypt::DES_EDE3::ProcessAndXorBlock(), TaoCrypt::DES_EDE2::ProcessAndXorBlock(), and TaoCrypt::DES::ProcessAndXorBlock().
00301 { 00302 word32 work; 00303 00304 right = rotrFixed(right, 1U); 00305 work = (left ^ right) & 0xaaaaaaaa; 00306 right ^= work; 00307 left = rotrFixed(left^work, 9U); 00308 work = (left ^ right) & 0x00ff00ff; 00309 right ^= work; 00310 left = rotlFixed(left^work, 6U); 00311 work = (left ^ right) & 0x33333333; 00312 right ^= work; 00313 left = rotlFixed(left^work, 18U); 00314 work = (left ^ right) & 0xffff0000; 00315 right ^= work; 00316 left = rotlFixed(left^work, 20U); 00317 work = (left ^ right) & 0xf0f0f0f0; 00318 right ^= work; 00319 left = rotrFixed(left^work, 4U); 00320 }
Here is the call graph for this function:

Here is the caller graph for this function:

| unsigned int TaoCrypt::@42::DiscreteLogWorkFactor | ( | unsigned int | n | ) | [static] |
Definition at line 40 of file dh.cpp.
References log().
Referenced by TaoCrypt::DH::GeneratePrivate().
00041 { 00042 // assuming discrete log takes about the same time as factoring 00043 if (n<5) 00044 return 0; 00045 else 00046 return (unsigned int)(2.4 * pow((double)n, 1.0/3.0) * 00047 pow(log(double(n)), 2.0/3.0) - 5); 00048 }
Here is the call graph for this function:

Here is the caller graph for this function:

| S TaoCrypt::DivideThreeWordsByTwo | ( | S * | A, | |
| S | B0, | |||
| S | B1, | |||
| D * | dummy_VC6_WorkAround = 0 | |||
| ) |
Definition at line 380 of file integer.cpp.
References assert, Multiply(), and Q.
00381 { 00382 // assert {A[2],A[1]} < {B1,B0}, so quotient can fit in a S 00383 assert(A[2] < B1 || (A[2]==B1 && A[1] < B0)); 00384 00385 // estimate the quotient: do a 2 S by 1 S divide 00386 S Q; 00387 if (S(B1+1) == 0) 00388 Q = A[2]; 00389 else 00390 Q = D(A[1], A[2]) / S(B1+1); 00391 00392 // now subtract Q*B from A 00393 D p = D::Multiply(B0, Q); 00394 D u = (D) A[0] - p.GetLowHalf(); 00395 A[0] = u.GetLowHalf(); 00396 u = (D) A[1] - p.GetHighHalf() - u.GetHighHalfAsBorrow() - 00397 D::Multiply(B1, Q); 00398 A[1] = u.GetLowHalf(); 00399 A[2] += u.GetHighHalf(); 00400 00401 // Q <= actual quotient, so fix it 00402 while (A[2] || A[1] > B1 || (A[1]==B1 && A[0]>=B0)) 00403 { 00404 u = (D) A[0] - B0; 00405 A[0] = u.GetLowHalf(); 00406 u = (D) A[1] - B1 - u.GetHighHalfAsBorrow(); 00407 A[1] = u.GetLowHalf(); 00408 A[2] += u.GetHighHalf(); 00409 Q++; 00410 assert(Q); // shouldn't overflow 00411 } 00412 00413 return Q; 00414 }
Here is the call graph for this function:

| D TaoCrypt::DivideFourWordsByTwo | ( | S * | T, | |
| const D & | Al, | |||
| const D & | Ah, | |||
| const D & | B | |||
| ) | [inline] |
Definition at line 419 of file integer.cpp.
References Q.
00420 { 00421 if (!B) // if divisor is 0, we assume divisor==2**(2*WORD_BITS) 00422 return D(Ah.GetLowHalf(), Ah.GetHighHalf()); 00423 else 00424 { 00425 S Q[2]; 00426 T[0] = Al.GetLowHalf(); 00427 T[1] = Al.GetHighHalf(); 00428 T[2] = Ah.GetLowHalf(); 00429 T[3] = Ah.GetHighHalf(); 00430 Q[1] = DivideThreeWordsByTwo<S, D>(T+1, B.GetLowHalf(), 00431 B.GetHighHalf()); 00432 Q[0] = DivideThreeWordsByTwo<S, D>(T, B.GetLowHalf(), B.GetHighHalf()); 00433 return D(Q[0], Q[1]); 00434 } 00435 }
| static unsigned int TaoCrypt::RoundupSize | ( | unsigned int | n | ) | [inline, static] |
Definition at line 481 of file integer.cpp.
References BitPrecision(), and RoundupSizeTable.
Referenced by TaoCrypt::Integer::Decode(), TaoCrypt::Integer::Divide(), TaoCrypt::Integer::DivideByPowerOf2(), TaoCrypt::Integer::operator<<=(), TaoCrypt::Integer::operator=(), PositiveDivide(), PositiveMultiply(), TaoCrypt::Integer::SetBit(), and TaoCrypt::Integer::SetByte().
00482 { 00483 if (n<=8) 00484 return RoundupSizeTable[n]; 00485 else if (n<=16) 00486 return 16; 00487 else if (n<=32) 00488 return 32; 00489 else if (n<=64) 00490 return 64; 00491 else return 1U << BitPrecision(n-1); 00492 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 495 of file integer.cpp.
Referenced by TaoCrypt::ModularArithmetic::Accumulate(), TaoCrypt::ModularArithmetic::Add(), AlmostInverse(), CorrectQuotientEstimate(), Divide(), MultiplyByPower2Mod(), TaoCrypt::Integer::PositiveCompare(), PositiveSubtract(), RecursiveMultiply(), and RecursiveMultiplyTop().
00496 { 00497 while (N--) 00498 if (A[N] > B[N]) 00499 return 1; 00500 else if (A[N] < B[N]) 00501 return -1; 00502 00503 return 0; 00504 }
Here is the caller graph for this function:

Definition at line 506 of file integer.cpp.
References assert.
Referenced by AsymmetricMultiply(), TaoCrypt::Integer::operator++(), TaoCrypt::Integer::operator--(), PositiveAdd(), RecursiveInverseModPower2(), RecursiveMultiply(), RecursiveMultiplyTop(), and RecursiveSquare().
00507 { 00508 assert(N); 00509 word t = A[0]; 00510 A[0] = t+B; 00511 if (A[0] >= t) 00512 return 0; 00513 for (unsigned i=1; i<N; i++) 00514 if (++A[i]) 00515 return 0; 00516 return 1; 00517 }
Here is the caller graph for this function:

Definition at line 519 of file integer.cpp.
References assert.
Referenced by TaoCrypt::ModularArithmetic::Inverse(), TaoCrypt::Integer::operator++(), TaoCrypt::Integer::operator--(), PositiveSubtract(), and TwosComplement().
00520 { 00521 assert(N); 00522 word t = A[0]; 00523 A[0] = t-B; 00524 if (A[0] <= t) 00525 return 0; 00526 for (unsigned i=1; i<N; i++) 00527 if (A[i]--) 00528 return 0; 00529 return 1; 00530 }
Here is the caller graph for this function:

| static void TaoCrypt::TwosComplement | ( | word * | A, | |
| unsigned int | N | |||
| ) | [static] |
Definition at line 532 of file integer.cpp.
References Decrement().
Referenced by TaoCrypt::Integer::Decode(), and RecursiveInverseModPower2().
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 540 of file integer.cpp.
References TaoCrypt::DWord::GetLowHalf(), and TaoCrypt::DWord::MultiplyAndAdd().
Referenced by AsymmetricMultiply(), and CorrectQuotientEstimate().
00541 { 00542 word carry=0; 00543 for(unsigned i=0; i<N; i++) 00544 { 00545 DWord p = DWord::MultiplyAndAdd(A[i], B, carry); 00546 C[i] = p.GetLowHalf(); 00547 carry = p.GetHighHalf(); 00548 } 00549 return carry; 00550 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 553 of file integer.cpp.
References assert, and WORD_BITS.
Referenced by RecursiveInverseModPower2().
00554 { 00555 assert(A%2==1); 00556 00557 word R=A%8; 00558 00559 for (unsigned i=3; i<WORD_BITS; i*=2) 00560 R = R*(2-R*A); 00561 00562 assert(word(R*A)==1); 00563 return R; 00564 }
Here is the caller graph for this function:

| void TaoCrypt::RecursiveMultiply | ( | word * | R, | |
| word * | T, | |||
| const word * | A, | |||
| const word * | B, | |||
| unsigned int | N | |||
| ) |
Definition at line 2154 of file integer.cpp.
References A0, A1, Add(), assert, B0, B1, Compare(), Increment(), R0, R1, R2, R3, SetWords(), Subtract(), T0, T1, and T2.
Referenced by Multiply(), RecursiveMultiplyBottom(), RecursiveMultiplyTop(), and RecursiveSquare().
02156 { 02157 assert(N>=2 && N%2==0); 02158 02159 if (LowLevel::MultiplyRecursionLimit() >= 8 && N==8) 02160 LowLevel::Multiply8(R, A, B); 02161 else if (LowLevel::MultiplyRecursionLimit() >= 4 && N==4) 02162 LowLevel::Multiply4(R, A, B); 02163 else if (N==2) 02164 LowLevel::Multiply2(R, A, B); 02165 else 02166 { 02167 const unsigned int N2 = N/2; 02168 int carry; 02169 02170 int aComp = Compare(A0, A1, N2); 02171 int bComp = Compare(B0, B1, N2); 02172 02173 switch (2*aComp + aComp + bComp) 02174 { 02175 case -4: 02176 LowLevel::Subtract(R0, A1, A0, N2); 02177 LowLevel::Subtract(R1, B0, B1, N2); 02178 RecursiveMultiply(T0, T2, R0, R1, N2); 02179 LowLevel::Subtract(T1, T1, R0, N2); 02180 carry = -1; 02181 break; 02182 case -2: 02183 LowLevel::Subtract(R0, A1, A0, N2); 02184 LowLevel::Subtract(R1, B0, B1, N2); 02185 RecursiveMultiply(T0, T2, R0, R1, N2); 02186 carry = 0; 02187 break; 02188 case 2: 02189 LowLevel::Subtract(R0, A0, A1, N2); 02190 LowLevel::Subtract(R1, B1, B0, N2); 02191 RecursiveMultiply(T0, T2, R0, R1, N2); 02192 carry = 0; 02193 break; 02194 case 4: 02195 LowLevel::Subtract(R0, A1, A0, N2); 02196 LowLevel::Subtract(R1, B0, B1, N2); 02197 RecursiveMultiply(T0, T2, R0, R1, N2); 02198 LowLevel::Subtract(T1, T1, R1, N2); 02199 carry = -1; 02200 break; 02201 default: 02202 SetWords(T0, 0, N); 02203 carry = 0; 02204 } 02205 02206 RecursiveMultiply(R0, T2, A0, B0, N2); 02207 RecursiveMultiply(R2, T2, A1, B1, N2); 02208 02209 // now T[01] holds (A1-A0)*(B0-B1),R[01] holds A0*B0, R[23] holds A1*B1 02210 02211 carry += LowLevel::Add(T0, T0, R0, N); 02212 carry += LowLevel::Add(T0, T0, R2, N); 02213 carry += LowLevel::Add(R1, R1, T0, N); 02214 02215 assert (carry >= 0 && carry <= 2); 02216 Increment(R3, N2, carry); 02217 } 02218 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2221 of file integer.cpp.
References A0, A1, Add(), assert, Increment(), R0, R1, R2, R3, RecursiveMultiply(), T0, and T2.
Referenced by Square().
02222 { 02223 assert(N && N%2==0); 02224 if (LowLevel::SquareRecursionLimit() >= 8 && N==8) 02225 LowLevel::Square8(R, A); 02226 if (LowLevel::SquareRecursionLimit() >= 4 && N==4) 02227 LowLevel::Square4(R, A); 02228 else if (N==2) 02229 LowLevel::Square2(R, A); 02230 else 02231 { 02232 const unsigned int N2 = N/2; 02233 02234 RecursiveSquare(R0, T2, A0, N2); 02235 RecursiveSquare(R2, T2, A1, N2); 02236 RecursiveMultiply(T0, T2, A0, A1, N2); 02237 02238 word carry = LowLevel::Add(R1, R1, T0, N); 02239 carry += LowLevel::Add(R1, R1, T0, N); 02240 Increment(R3, N2, carry); 02241 } 02242 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::RecursiveMultiplyBottom | ( | word * | R, | |
| word * | T, | |||
| const word * | A, | |||
| const word * | B, | |||
| unsigned int | N | |||
| ) |
Definition at line 2251 of file integer.cpp.
References A0, A1, Add(), assert, B0, B1, R1, RecursiveMultiply(), T0, and T1.
Referenced by MultiplyBottom().
02253 { 02254 assert(N>=2 && N%2==0); 02255 if (LowLevel::MultiplyBottomRecursionLimit() >= 8 && N==8) 02256 LowLevel::Multiply8Bottom(R, A, B); 02257 else if (LowLevel::MultiplyBottomRecursionLimit() >= 4 && N==4) 02258 LowLevel::Multiply4Bottom(R, A, B); 02259 else if (N==2) 02260 LowLevel::Multiply2Bottom(R, A, B); 02261 else 02262 { 02263 const unsigned int N2 = N/2; 02264 02265 RecursiveMultiply(R, T, A0, B0, N2); 02266 RecursiveMultiplyBottom(T0, T1, A1, B0, N2); 02267 LowLevel::Add(R1, R1, T0, N2); 02268 RecursiveMultiplyBottom(T0, T1, A0, B1, N2); 02269 LowLevel::Add(R1, R1, T0, N2); 02270 } 02271 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::RecursiveMultiplyTop | ( | word * | R, | |
| word * | T, | |||
| const word * | L, | |||
| const word * | A, | |||
| const word * | B, | |||
| unsigned int | N | |||
| ) |
Definition at line 2274 of file integer.cpp.
References A0, A1, Add(), assert, B0, B1, Compare(), CopyWords(), Increment(), memcpy, R0, R1, RecursiveMultiply(), SetWords(), Subtract(), T0, T1, T2, and WORD_SIZE.
Referenced by MultiplyTop().
02276 { 02277 assert(N>=2 && N%2==0); 02278 02279 if (N==4) 02280 { 02281 LowLevel::Multiply4(T, A, B); 02282 memcpy(R, T+4, 4*WORD_SIZE); 02283 } 02284 else if (N==2) 02285 { 02286 LowLevel::Multiply2(T, A, B); 02287 memcpy(R, T+2, 2*WORD_SIZE); 02288 } 02289 else 02290 { 02291 const unsigned int N2 = N/2; 02292 int carry; 02293 02294 int aComp = Compare(A0, A1, N2); 02295 int bComp = Compare(B0, B1, N2); 02296 02297 switch (2*aComp + aComp + bComp) 02298 { 02299 case -4: 02300 LowLevel::Subtract(R0, A1, A0, N2); 02301 LowLevel::Subtract(R1, B0, B1, N2); 02302 RecursiveMultiply(T0, T2, R0, R1, N2); 02303 LowLevel::Subtract(T1, T1, R0, N2); 02304 carry = -1; 02305 break; 02306 case -2: 02307 LowLevel::Subtract(R0, A1, A0, N2); 02308 LowLevel::Subtract(R1, B0, B1, N2); 02309 RecursiveMultiply(T0, T2, R0, R1, N2); 02310 carry = 0; 02311 break; 02312 case 2: 02313 LowLevel::Subtract(R0, A0, A1, N2); 02314 LowLevel::Subtract(R1, B1, B0, N2); 02315 RecursiveMultiply(T0, T2, R0, R1, N2); 02316 carry = 0; 02317 break; 02318 case 4: 02319 LowLevel::Subtract(R0, A1, A0, N2); 02320 LowLevel::Subtract(R1, B0, B1, N2); 02321 RecursiveMultiply(T0, T2, R0, R1, N2); 02322 LowLevel::Subtract(T1, T1, R1, N2); 02323 carry = -1; 02324 break; 02325 default: 02326 SetWords(T0, 0, N); 02327 carry = 0; 02328 } 02329 02330 RecursiveMultiply(T2, R0, A1, B1, N2); 02331 02332 // now T[01] holds (A1-A0)*(B0-B1), T[23] holds A1*B1 02333 02334 word c2 = LowLevel::Subtract(R0, L+N2, L, N2); 02335 c2 += LowLevel::Subtract(R0, R0, T0, N2); 02336 word t = (Compare(R0, T2, N2) == -1); 02337 02338 carry += t; 02339 carry += Increment(R0, N2, c2+t); 02340 carry += LowLevel::Add(R0, R0, T1, N2); 02341 carry += LowLevel::Add(R0, R0, T3, N2); 02342 assert (carry >= 0 && carry <= 2); 02343 02344 CopyWords(R1, T3, N2); 02345 Increment(R1, N2, carry); 02346 } 02347 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2350 of file integer.cpp.
Referenced by TaoCrypt::ModularArithmetic::Accumulate(), TaoCrypt::ModularArithmetic::Add(), AlmostInverse(), AsymmetricMultiply(), AtomicDivide(), DivideByPower2Mod(), MontgomeryReduce(), PositiveAdd(), RecursiveInverseModPower2(), RecursiveMultiply(), RecursiveMultiplyBottom(), RecursiveMultiplyTop(), RecursiveSquare(), TaoCrypt::ModularArithmetic::Reduce(), and TaoCrypt::ModularArithmetic::Subtract().
02351 { 02352 return LowLevel::Add(C, A, B, N); 02353 }
Here is the caller graph for this function:

Definition at line 2355 of file integer.cpp.
Referenced by TaoCrypt::ModularArithmetic::Accumulate(), TaoCrypt::ModularArithmetic::Add(), AlmostInverse(), CorrectQuotientEstimate(), Divide(), TaoCrypt::ModularArithmetic::Inverse(), MontgomeryReduce(), MultiplyByPower2Mod(), PositiveSubtract(), RecursiveMultiply(), RecursiveMultiplyTop(), TaoCrypt::ModularArithmetic::Reduce(), and TaoCrypt::ModularArithmetic::Subtract().
02356 { 02357 return LowLevel::Subtract(C, A, B, N); 02358 }
Here is the caller graph for this function:

| void TaoCrypt::Multiply | ( | word * | R, | |
| word * | T, | |||
| const word * | A, | |||
| const word * | B, | |||
| unsigned int | N | |||
| ) | [inline] |
Definition at line 2360 of file integer.cpp.
References RecursiveMultiply().
Referenced by AsymmetricMultiply(), DivideThreeWordsByTwo(), TaoCrypt::Portable::Multiply2(), TaoCrypt::Portable::Multiply2Add(), TaoCrypt::Portable::Multiply2Bottom(), TaoCrypt::Portable::Multiply4(), TaoCrypt::Portable::Multiply4Bottom(), TaoCrypt::Portable::Multiply8(), TaoCrypt::Portable::Multiply8Bottom(), TaoCrypt::Portable::Square2(), TaoCrypt::Portable::Square4(), and TaoCrypt::Integer::Times().
02362 { 02363 RecursiveMultiply(R, T, A, B, N); 02364 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2366 of file integer.cpp.
References RecursiveSquare().
Referenced by AsymmetricMultiply(), and TaoCrypt::MontgomeryRepresentation::Square().
02367 { 02368 RecursiveSquare(R, T, A, N); 02369 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::AsymmetricMultiply | ( | word * | R, | |
| word * | T, | |||
| const word * | A, | |||
| unsigned int | NA, | |||
| const word * | B, | |||
| unsigned int | NB | |||
| ) |
Definition at line 2372 of file integer.cpp.
References Add(), assert, CopyWords(), Increment(), LinearMultiply(), Multiply(), SetWords(), Square(), and mySTL::swap().
Referenced by TaoCrypt::MontgomeryRepresentation::Multiply(), and PositiveMultiply().
02374 { 02375 if (NA == NB) 02376 { 02377 if (A == B) 02378 Square(R, T, A, NA); 02379 else 02380 Multiply(R, T, A, B, NA); 02381 02382 return; 02383 } 02384 02385 if (NA > NB) 02386 { 02387 mySTL::swap(A, B); 02388 mySTL::swap(NA, NB); 02389 } 02390 02391 assert(NB % NA == 0); 02392 assert((NB/NA)%2 == 0); // NB is an even multiple of NA 02393 02394 if (NA==2 && !A[1]) 02395 { 02396 switch (A[0]) 02397 { 02398 case 0: 02399 SetWords(R, 0, NB+2); 02400 return; 02401 case 1: 02402 CopyWords(R, B, NB); 02403 R[NB] = R[NB+1] = 0; 02404 return; 02405 default: 02406 R[NB] = LinearMultiply(R, B, A[0], NB); 02407 R[NB+1] = 0; 02408 return; 02409 } 02410 } 02411 02412 Multiply(R, T, A, B, NA); 02413 CopyWords(T+2*NA, R+NA, NA); 02414 02415 unsigned i; 02416 02417 for (i=2*NA; i<NB; i+=2*NA) 02418 Multiply(T+NA+i, T, A, B+i, NA); 02419 for (i=NA; i<NB; i+=2*NA) 02420 Multiply(R+i, T, A, B+i, NA); 02421 02422 if (Add(R+NA, R+NA, T+2*NA, NB-NA)) 02423 Increment(R+NB, NA); 02424 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::PositiveMultiply | ( | Integer & | product, | |
| const Integer & | a, | |||
| const Integer & | b | |||
| ) |
Definition at line 2427 of file integer.cpp.
References AsymmetricMultiply(), TaoCrypt::Block< T, A >::CleanNew(), TaoCrypt::Block< T, A >::get_buffer(), TaoCrypt::Integer::reg_, RoundupSize(), TaoCrypt::Integer::sign_, and TaoCrypt::Integer::WordCount().
Referenced by Multiply().
02428 { 02429 unsigned int aSize = RoundupSize(a.WordCount()); 02430 unsigned int bSize = RoundupSize(b.WordCount()); 02431 02432 product.reg_.CleanNew(RoundupSize(aSize + bSize)); 02433 product.sign_ = Integer::POSITIVE; 02434 02435 AlignedWordBlock workspace(aSize + bSize); 02436 AsymmetricMultiply(product.reg_.get_buffer(), workspace.get_buffer(), 02437 a.reg_.get_buffer(), aSize, b.reg_.get_buffer(), bSize); 02438 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::Multiply | ( | Integer & | product, | |
| const Integer & | a, | |||
| const Integer & | b | |||
| ) |
Definition at line 2440 of file integer.cpp.
References TaoCrypt::Integer::Negate(), TaoCrypt::Integer::NotNegative(), and PositiveMultiply().
02441 { 02442 PositiveMultiply(product, a, b); 02443 02444 if (a.NotNegative() != b.NotNegative()) 02445 product.Negate(); 02446 }
Here is the call graph for this function:

| static unsigned int TaoCrypt::EvenWordCount | ( | const word * | X, | |
| unsigned int | N | |||
| ) | [inline, static] |
Definition at line 2449 of file integer.cpp.
Referenced by AlmostInverse().
Here is the caller graph for this function:

| unsigned int TaoCrypt::AlmostInverse | ( | word * | R, | |
| word * | T, | |||
| const word * | A, | |||
| unsigned int | NA, | |||
| const word * | M, | |||
| unsigned int | N | |||
| ) |
Definition at line 2457 of file integer.cpp.
References Add(), assert, Compare(), CopyWords(), EvenWordCount(), f, SetWords(), ShiftWordsLeftByBits(), ShiftWordsLeftByWords(), ShiftWordsRightByBits(), ShiftWordsRightByWords(), Subtract(), mySTL::swap(), and WORD_BITS.
Referenced by TaoCrypt::Integer::InverseMod(), and TaoCrypt::MontgomeryRepresentation::MultiplicativeInverse().
02459 { 02460 assert(NA<=N && N && N%2==0); 02461 02462 word *b = T; 02463 word *c = T+N; 02464 word *f = T+2*N; 02465 word *g = T+3*N; 02466 unsigned int bcLen=2, fgLen=EvenWordCount(M, N); 02467 unsigned int k=0, s=0; 02468 02469 SetWords(T, 0, 3*N); 02470 b[0]=1; 02471 CopyWords(f, A, NA); 02472 CopyWords(g, M, N); 02473 02474 while (1) 02475 { 02476 word t=f[0]; 02477 while (!t) 02478 { 02479 if (EvenWordCount(f, fgLen)==0) 02480 { 02481 SetWords(R, 0, N); 02482 return 0; 02483 } 02484 02485 ShiftWordsRightByWords(f, fgLen, 1); 02486 if (c[bcLen-1]) bcLen+=2; 02487 assert(bcLen <= N); 02488 ShiftWordsLeftByWords(c, bcLen, 1); 02489 k+=WORD_BITS; 02490 t=f[0]; 02491 } 02492 02493 unsigned int i=0; 02494 while (t%2 == 0) 02495 { 02496 t>>=1; 02497 i++; 02498 } 02499 k+=i; 02500 02501 if (t==1 && f[1]==0 && EvenWordCount(f, fgLen)==2) 02502 { 02503 if (s%2==0) 02504 CopyWords(R, b, N); 02505 else 02506 Subtract(R, M, b, N); 02507 return k; 02508 } 02509 02510 ShiftWordsRightByBits(f, fgLen, i); 02511 t=ShiftWordsLeftByBits(c, bcLen, i); 02512 if (t) 02513 { 02514 c[bcLen] = t; 02515 bcLen+=2; 02516 assert(bcLen <= N); 02517 } 02518 02519 if (f[fgLen-2]==0 && g[fgLen-2]==0 && f[fgLen-1]==0 && g[fgLen-1]==0) 02520 fgLen-=2; 02521 02522 if (Compare(f, g, fgLen)==-1) 02523 { 02524 mySTL::swap(f, g); 02525 mySTL::swap(b, c); 02526 s++; 02527 } 02528 02529 Subtract(f, f, g, fgLen); 02530 02531 if (Add(b, b, c, bcLen)) 02532 { 02533 b[bcLen] = 1; 02534 bcLen+=2; 02535 assert(bcLen <= N); 02536 } 02537 } 02538 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::DivideByPower2Mod | ( | word * | R, | |
| const word * | A, | |||
| unsigned int | k, | |||
| const word * | M, | |||
| unsigned int | N | |||
| ) |
Definition at line 2544 of file integer.cpp.
References Add(), CopyWords(), ShiftWordsRightByBits(), and WORD_BITS.
Referenced by TaoCrypt::ModularArithmetic::Half(), TaoCrypt::Integer::InverseMod(), and TaoCrypt::MontgomeryRepresentation::MultiplicativeInverse().
02546 { 02547 CopyWords(R, A, N); 02548 02549 while (k--) 02550 { 02551 if (R[0]%2==0) 02552 ShiftWordsRightByBits(R, N, 1); 02553 else 02554 { 02555 word carry = Add(R, R, M, N); 02556 ShiftWordsRightByBits(R, N, 1); 02557 R[N-1] += carry<<(WORD_BITS-1); 02558 } 02559 } 02560 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::MultiplyByPower2Mod | ( | word * | R, | |
| const word * | A, | |||
| unsigned int | k, | |||
| const word * | M, | |||
| unsigned int | N | |||
| ) |
Definition at line 2566 of file integer.cpp.
References Compare(), CopyWords(), ShiftWordsLeftByBits(), and Subtract().
Referenced by TaoCrypt::MontgomeryRepresentation::MultiplicativeInverse().
02568 { 02569 CopyWords(R, A, N); 02570 02571 while (k--) 02572 if (ShiftWordsLeftByBits(R, N, 1) || Compare(R, M, N)>=0) 02573 Subtract(R, R, M, N); 02574 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::PositiveAdd | ( | Integer & | sum, | |
| const Integer & | a, | |||
| const Integer & | b | |||
| ) |
Definition at line 2964 of file integer.cpp.
References Add(), TaoCrypt::Block< T, A >::CleanGrow(), CopyWords(), TaoCrypt::Block< T, A >::get_buffer(), Increment(), TaoCrypt::Integer::POSITIVE, TaoCrypt::Integer::reg_, TaoCrypt::Integer::sign_, and TaoCrypt::Block< T, A >::size().
02965 { 02966 word carry; 02967 if (a.reg_.size() == b.reg_.size()) 02968 carry = Add(sum.reg_.get_buffer(), a.reg_.get_buffer(), 02969 b.reg_.get_buffer(), a.reg_.size()); 02970 else if (a.reg_.size() > b.reg_.size()) 02971 { 02972 carry = Add(sum.reg_.get_buffer(), a.reg_.get_buffer(), 02973 b.reg_.get_buffer(), b.reg_.size()); 02974 CopyWords(sum.reg_+b.reg_.size(), a.reg_+b.reg_.size(), 02975 a.reg_.size()-b.reg_.size()); 02976 carry = Increment(sum.reg_+b.reg_.size(), a.reg_.size()-b.reg_.size(), 02977 carry); 02978 } 02979 else 02980 { 02981 carry = Add(sum.reg_.get_buffer(), a.reg_.get_buffer(), 02982 b.reg_.get_buffer(), a.reg_.size()); 02983 CopyWords(sum.reg_+a.reg_.size(), b.reg_+a.reg_.size(), 02984 b.reg_.size()-a.reg_.size()); 02985 carry = Increment(sum.reg_+a.reg_.size(), b.reg_.size()-a.reg_.size(), 02986 carry); 02987 } 02988 02989 if (carry) 02990 { 02991 sum.reg_.CleanGrow(2*sum.reg_.size()); 02992 sum.reg_[sum.reg_.size()/2] = 1; 02993 } 02994 sum.sign_ = Integer::POSITIVE; 02995 }
Here is the call graph for this function:

| void TaoCrypt::PositiveSubtract | ( | Integer & | diff, | |
| const Integer & | a, | |||
| const Integer & | b | |||
| ) |
Definition at line 2997 of file integer.cpp.
References assert, Compare(), CopyWords(), Decrement(), TaoCrypt::Block< T, A >::get_buffer(), TaoCrypt::Integer::NEGATIVE, TaoCrypt::Integer::POSITIVE, TaoCrypt::Integer::reg_, TaoCrypt::Integer::sign_, Subtract(), and TaoCrypt::Integer::WordCount().
02998 { 02999 unsigned aSize = a.WordCount(); 03000 aSize += aSize%2; 03001 unsigned bSize = b.WordCount(); 03002 bSize += bSize%2; 03003 03004 if (aSize == bSize) 03005 { 03006 if (Compare(a.reg_.get_buffer(), b.reg_.get_buffer(), aSize) >= 0) 03007 { 03008 Subtract(diff.reg_.get_buffer(), a.reg_.get_buffer(), 03009 b.reg_.get_buffer(), aSize); 03010 diff.sign_ = Integer::POSITIVE; 03011 } 03012 else 03013 { 03014 Subtract(diff.reg_.get_buffer(), b.reg_.get_buffer(), 03015 a.reg_.get_buffer(), aSize); 03016 diff.sign_ = Integer::NEGATIVE; 03017 } 03018 } 03019 else if (aSize > bSize) 03020 { 03021 word borrow = Subtract(diff.reg_.get_buffer(), a.reg_.get_buffer(), 03022 b.reg_.get_buffer(), bSize); 03023 CopyWords(diff.reg_+bSize, a.reg_+bSize, aSize-bSize); 03024 borrow = Decrement(diff.reg_+bSize, aSize-bSize, borrow); 03025 assert(!borrow); 03026 diff.sign_ = Integer::POSITIVE; 03027 } 03028 else 03029 { 03030 word borrow = Subtract(diff.reg_.get_buffer(), b.reg_.get_buffer(), 03031 a.reg_.get_buffer(), aSize); 03032 CopyWords(diff.reg_+aSize, b.reg_+aSize, bSize-aSize); 03033 borrow = Decrement(diff.reg_+aSize, bSize-aSize, borrow); 03034 assert(!borrow); 03035 diff.sign_ = Integer::NEGATIVE; 03036 } 03037 }
Here is the call graph for this function:

Definition at line 3241 of file integer.cpp.
References Add(), assert, TaoCrypt::DWord::GetHighHalf(), TaoCrypt::DWord::GetLowHalf(), memcmp(), TaoCrypt::Portable::Multiply2(), and WORD_SIZE.
Referenced by Divide().
03242 { 03243 word T[4]; 03244 DWord q = DivideFourWordsByTwo<word, DWord>(T, DWord(A[0], A[1]), 03245 DWord(A[2], A[3]), DWord(B[0], B[1])); 03246 Q[0] = q.GetLowHalf(); 03247 Q[1] = q.GetHighHalf(); 03248 03249 #ifndef NDEBUG 03250 if (B[0] || B[1]) 03251 { 03252 // multiply quotient and divisor and add remainder, make sure it 03253 // equals dividend 03254 assert(!T[2] && !T[3] && (T[1] < B[1] || (T[1]==B[1] && T[0]<B[0]))); 03255 word P[4]; 03256 Portable::Multiply2(P, Q, B); 03257 Add(P, P, T, 4); 03258 assert(memcmp(P, A, 4*WORD_SIZE)==0); 03259 } 03260 #endif 03261 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void TaoCrypt::CorrectQuotientEstimate | ( | word * | R, | |
| word * | T, | |||
| word * | Q, | |||
| const word * | B, | |||
| unsigned int | N | |||
| ) | [static] |
Definition at line 3265 of file integer.cpp.
References assert, Compare(), LinearMultiply(), TaoCrypt::Portable::Multiply2(), TaoCrypt::Portable::Multiply2Add(), and Subtract().
Referenced by Divide().
03267 { 03268 assert(N && N%2==0); 03269 03270 if (Q[1]) 03271 { 03272 T[N] = T[N+1] = 0; 03273 unsigned i; 03274 for (i=0; i<N; i+=4) 03275 LowLevel::Multiply2(T+i, Q, B+i); 03276 for (i=2; i<N; i+=4) 03277 if (LowLevel::Multiply2Add(T+i, Q, B+i)) 03278 T[i+5] += (++T[i+4]==0); 03279 } 03280 else 03281 { 03282 T[N] = LinearMultiply(T, B, Q[0], N); 03283 T[N+1] = 0; 03284 } 03285 03286 word borrow = Subtract(R, R, T, N+2); 03287 assert(!borrow && !R[N+1]); 03288 03289 while (R[N] || Compare(R, B, N) >= 0) 03290 { 03291 R[N] -= Subtract(R, R, B, N); 03292 Q[1] += (++Q[0]==0); 03293 assert(Q[0] || Q[1]); // no overflow 03294 } 03295 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::Divide | ( | word * | R, | |
| word * | Q, | |||
| word * | T, | |||
| const word * | A, | |||
| unsigned int | NA, | |||
| const word * | B, | |||
| unsigned int | NB | |||
| ) |
Definition at line 3304 of file integer.cpp.
References assert, AtomicDivide(), BitPrecision(), Compare(), CopyWords(), CorrectQuotientEstimate(), ShiftWordsLeftByBits(), ShiftWordsRightByBits(), Subtract(), and WORD_BITS.
Referenced by TaoCrypt::Integer::DividedBy(), TaoCrypt::EuclideanDomainOf::DivisionAlgorithm(), TaoCrypt::Integer::Modulo(), and PositiveDivide().
03306 { 03307 assert(NA && NB && NA%2==0 && NB%2==0); 03308 assert(B[NB-1] || B[NB-2]); 03309 assert(NB <= NA); 03310 03311 // set up temporary work space 03312 word *const TA=T; 03313 word *const TB=T+NA+2; 03314 word *const TP=T+NA+2+NB; 03315 03316 // copy B into TB and normalize it so that TB has highest bit set to 1 03317 unsigned shiftWords = (B[NB-1]==0); 03318 TB[0] = TB[NB-1] = 0; 03319 CopyWords(TB+shiftWords, B, NB-shiftWords); 03320 unsigned shiftBits = WORD_BITS - BitPrecision(TB[NB-1]); 03321 assert(shiftBits < WORD_BITS); 03322 ShiftWordsLeftByBits(TB, NB, shiftBits); 03323 03324 // copy A into TA and normalize it 03325 TA[0] = TA[NA] = TA[NA+1] = 0; 03326 CopyWords(TA+shiftWords, A, NA); 03327 ShiftWordsLeftByBits(TA, NA+2, shiftBits); 03328 03329 if (TA[NA+1]==0 && TA[NA] <= 1) 03330 { 03331 Q[NA-NB+1] = Q[NA-NB] = 0; 03332 while (TA[NA] || Compare(TA+NA-NB, TB, NB) >= 0) 03333 { 03334 TA[NA] -= Subtract(TA+NA-NB, TA+NA-NB, TB, NB); 03335 ++Q[NA-NB]; 03336 } 03337 } 03338 else 03339 { 03340 NA+=2; 03341 assert(Compare(TA+NA-NB, TB, NB) < 0); 03342 } 03343 03344 word BT[2]; 03345 BT[0] = TB[NB-2] + 1; 03346 BT[1] = TB[NB-1] + (BT[0]==0); 03347 03348 // start reducing TA mod TB, 2 words at a time 03349 for (unsigned i=NA-2; i>=NB; i-=2) 03350 { 03351 AtomicDivide(Q+i-NB, TA+i-2, BT); 03352 CorrectQuotientEstimate(TA+i-NB, TP, Q+i-NB, TB, NB); 03353 } 03354 03355 // copy TA into R, and denormalize it 03356 CopyWords(R, TA+shiftWords, NB); 03357 ShiftWordsRightByBits(R, NB, shiftBits); 03358 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::PositiveDivide | ( | Integer & | remainder, | |
| Integer & | quotient, | |||
| const Integer & | a, | |||
| const Integer & | b | |||
| ) |
Definition at line 3361 of file integer.cpp.
References assert, TaoCrypt::Block< T, A >::CleanNew(), Divide(), TaoCrypt::Block< T, A >::get_buffer(), TaoCrypt::Integer::POSITIVE, TaoCrypt::Integer::PositiveCompare(), TaoCrypt::Integer::reg_, RoundupSize(), TaoCrypt::Integer::sign_, TaoCrypt::Integer::WordCount(), and TaoCrypt::Integer::Zero().
03363 { 03364 unsigned aSize = a.WordCount(); 03365 unsigned bSize = b.WordCount(); 03366 03367 assert(bSize); 03368 03369 if (a.PositiveCompare(b) == -1) 03370 { 03371 remainder = a; 03372 remainder.sign_ = Integer::POSITIVE; 03373 quotient = Integer::Zero(); 03374 return; 03375 } 03376 03377 aSize += aSize%2; // round up to next even number 03378 bSize += bSize%2; 03379 03380 remainder.reg_.CleanNew(RoundupSize(bSize)); 03381 remainder.sign_ = Integer::POSITIVE; 03382 quotient.reg_.CleanNew(RoundupSize(aSize-bSize+2)); 03383 quotient.sign_ = Integer::POSITIVE; 03384 03385 AlignedWordBlock T(aSize+2*bSize+4); 03386 Divide(remainder.reg_.get_buffer(), quotient.reg_.get_buffer(), 03387 T.get_buffer(), a.reg_.get_buffer(), aSize, b.reg_.get_buffer(), 03388 bSize); 03389 }
Here is the call graph for this function:

| Integer TaoCrypt::a_times_b_mod_c | ( | const Integer & | x, | |
| const Integer & | y, | |||
| const Integer & | m | |||
| ) |
| Integer TaoCrypt::a_exp_b_mod_c | ( | const Integer & | x, | |
| const Integer & | e, | |||
| const Integer & | m | |||
| ) |
Definition at line 3576 of file integer.cpp.
References e, TaoCrypt::AbstractRing::Exponentiate(), and x.
Referenced by TaoCrypt::DH::Agree(), TaoCrypt::RSA_PublicKey::ApplyFunction(), TaoCrypt::DH::GeneratePublic(), ModularExponentiation(), and TaoCrypt::DSA_Signer::Sign().
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::MultiplyBottom | ( | word * | R, | |
| word * | T, | |||
| const word * | A, | |||
| const word * | B, | |||
| unsigned int | N | |||
| ) | [inline] |
Definition at line 3806 of file integer.cpp.
References RecursiveMultiplyBottom().
Referenced by MontgomeryReduce(), and RecursiveInverseModPower2().
03808 { 03809 RecursiveMultiplyBottom(R, T, A, B, N); 03810 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::MultiplyTop | ( | word * | R, | |
| word * | T, | |||
| const word * | L, | |||
| const word * | A, | |||
| const word * | B, | |||
| unsigned int | N | |||
| ) | [inline] |
Definition at line 3812 of file integer.cpp.
References RecursiveMultiplyTop().
Referenced by MontgomeryReduce(), and RecursiveInverseModPower2().
03814 { 03815 RecursiveMultiplyTop(R, T, L, A, B, N); 03816 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void TaoCrypt::MontgomeryReduce | ( | word * | R, | |
| word * | T, | |||
| const word * | X, | |||
| const word * | M, | |||
| const word * | U, | |||
| unsigned int | N | |||
| ) |
Definition at line 3825 of file integer.cpp.
References Add(), assert, CopyWords(), MultiplyBottom(), MultiplyTop(), and Subtract().
Referenced by TaoCrypt::MontgomeryRepresentation::ConvertOut(), TaoCrypt::MontgomeryRepresentation::MultiplicativeInverse(), TaoCrypt::MontgomeryRepresentation::Multiply(), and TaoCrypt::MontgomeryRepresentation::Square().
03827 { 03828 MultiplyBottom(R, T, X, U, N); 03829 MultiplyTop(T, T+N, X, R, M, N); 03830 word borrow = Subtract(T, X+N, T, N); 03831 // defend against timing attack by doing this Add even when not needed 03832 word carry = Add(T+N, T, M, N); 03833 assert(carry || !borrow); 03834 CopyWords(R, T + (borrow ? N : 0), N); 03835 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3841 of file integer.cpp.
References A0, A1, Add(), AtomicInverseModPower2(), Increment(), TaoCrypt::Portable::Multiply2Bottom(), MultiplyBottom(), MultiplyTop(), R0, R1, SetWords(), T0, T1, and TwosComplement().
Referenced by TaoCrypt::MontgomeryRepresentation::MontgomeryRepresentation().
03842 { 03843 if (N==2) 03844 { 03845 T[0] = AtomicInverseModPower2(A[0]); 03846 T[1] = 0; 03847 LowLevel::Multiply2Bottom(T+2, T, A); 03848 TwosComplement(T+2, 2); 03849 Increment(T+2, 2, 2); 03850 LowLevel::Multiply2Bottom(R, T, T+2); 03851 } 03852 else 03853 { 03854 const unsigned int N2 = N/2; 03855 RecursiveInverseModPower2(R0, T0, A0, N2); 03856 T0[0] = 1; 03857 SetWords(T0+1, 0, N2-1); 03858 MultiplyTop(R1, T1, T0, R0, A0, N2); 03859 MultiplyBottom(T0, T1, R0, A1, N2); 03860 Add(T0, R1, T0, N2); 03861 TwosComplement(T0, N2); 03862 MultiplyBottom(R1, T1, R0, T0, N2); 03863 } 03864 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static unsigned int TaoCrypt::@46::Mod | ( | unsigned int | c | ) | [inline, static] |
Definition at line 114 of file twofish.cpp.
Referenced by ReedSolomon().
00115 { 00116 static const unsigned int modulus = 0x14d; 00117 unsigned int c2 = (c<<1) ^ ((c & 0x80) ? modulus : 0); 00118 unsigned int c1 = c2 ^ (c>>1) ^ ((c & 1) ? (modulus>>1) : 0); 00119 return c | (c1 << 8) | (c2 << 16) | (c1 << 24); 00120 }
Here is the caller graph for this function:

Definition at line 124 of file twofish.cpp.
References Mod().
Referenced by TaoCrypt::Twofish::SetKey().
00125 { 00126 for (unsigned int i=0; i<8; i++) { 00127 high = Mod(high>>24) ^ (high<<8) ^ (low>>24); 00128 low <<= 8; 00129 } 00130 return high; 00131 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const word32 TaoCrypt::WORD_SIZE = sizeof(word) |
Definition at line 96 of file types.hpp.
Referenced by AtomicDivide(), TaoCrypt::Integer::ByteCount(), BytesToWords(), TaoCrypt::Integer::Decode(), TaoCrypt::Integer::GetByte(), RecursiveMultiplyTop(), TaoCrypt::Integer::SetByte(), and xorbuf().
| const word32 TaoCrypt::WORD_BITS = WORD_SIZE * 8 |
Definition at line 97 of file types.hpp.
Referenced by AlmostInverse(), AtomicInverseModPower2(), TaoCrypt::Integer::BitCount(), BitsToWords(), TaoCrypt::MontgomeryRepresentation::ConvertIn(), Divide(), DivideByPower2Mod(), TaoCrypt::Integer::DivideByPowerOf2(), TaoCrypt::WindowSlider::FindNextWindow(), TaoCrypt::Integer::GetBit(), TaoCrypt::Word::GetHighHalf(), TaoCrypt::Word::GetHighHalfAsBorrow(), TaoCrypt::MontgomeryRepresentation::MultiplicativeIdentity(), TaoCrypt::MontgomeryRepresentation::MultiplicativeInverse(), TaoCrypt::DWord::operator%(), TaoCrypt::Integer::operator<<=(), TaoCrypt::Integer::operator>>=(), TaoCrypt::Integer::SetBit(), ShiftWordsLeftByBits(), ShiftWordsRightByBits(), and TaoCrypt::Word::Word().
const byte TaoCrypt::bad = 0xFF [static] |
const byte TaoCrypt::hexEncode[] [static] |
Initial value:
{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F'
}
Definition at line 41 of file coding.cpp.
Referenced by TaoCrypt::HexEncoder::Encode().
const byte TaoCrypt::hexDecode[] [static] |
Initial value:
Definition at line 45 of file coding.cpp.
Referenced by TaoCrypt::HexDecoder::Decode().
const byte TaoCrypt::base64Encode[] [static] |
Initial value:
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'+', '/'
}
Definition at line 51 of file coding.cpp.
Referenced by TaoCrypt::Base64Encoder::Encode().
const byte TaoCrypt::base64Decode[] [static] |
Initial value:
{ 62, bad, bad, bad, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
bad, bad, bad, bad, bad, bad, bad,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25,
bad, bad, bad, bad, bad, bad,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51
}
Definition at line 61 of file coding.cpp.
Referenced by TaoCrypt::Base64Decoder::Decode().
const byte TaoCrypt::pad = '=' [static] |
Definition at line 73 of file coding.cpp.
Referenced by yaSSL::buildMessage(), yaSSL::cipherFinished(), TaoCrypt::Base64Decoder::Decode(), TaoCrypt::Base64Encoder::Encode(), NdbDictInterface::get_file(), NdbDictInterface::get_filegroup(), NdbDictInterface::getTable(), yaSSL::Data::Process(), and Item_func_lpad::val_str().
const int TaoCrypt::pemLineSz = 64 [static] |
Definition at line 74 of file coding.cpp.
Referenced by TaoCrypt::Base64Decoder::Decode(), and TaoCrypt::Base64Encoder::Encode().
const byte TaoCrypt::pc1[] [static] |
Initial value:
{
57, 49, 41, 33, 25, 17, 9,
1, 58, 50, 42, 34, 26, 18,
10, 2, 59, 51, 43, 35, 27,
19, 11, 3, 60, 52, 44, 36,
63, 55, 47, 39, 31, 23, 15,
7, 62, 54, 46, 38, 30, 22,
14, 6, 61, 53, 45, 37, 29,
21, 13, 5, 28, 20, 12, 4
}
Definition at line 49 of file des.cpp.
Referenced by TaoCrypt::BasicDES::SetKey().
const byte TaoCrypt::totrot[] [static] |
Initial value:
{
1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28
}
Definition at line 62 of file des.cpp.
Referenced by TaoCrypt::BasicDES::SetKey().
const byte TaoCrypt::pc2[] [static] |
Initial value:
{
14, 17, 11, 24, 1, 5,
3, 28, 15, 6, 21, 10,
23, 19, 12, 4, 26, 8,
16, 7, 27, 20, 13, 2,
41, 52, 31, 37, 47, 55,
30, 40, 51, 45, 33, 48,
44, 49, 39, 56, 34, 53,
46, 42, 50, 36, 29, 32
}
Definition at line 67 of file des.cpp.
Referenced by TaoCrypt::BasicDES::SetKey().
const int TaoCrypt::bytebit[] [static] |
Initial value:
{
0200,0100,040,020,010,04,02,01
}
Definition at line 81 of file des.cpp.
Referenced by TaoCrypt::BasicDES::SetKey().
| const word32 TaoCrypt::Spbox[8][64] |
const unsigned int TaoCrypt::RoundupSizeTable[] = {2, 2, 2, 4, 4, 8, 8, 8, 8} [static] |
Integer* TaoCrypt::zero = 0 [static] |
Definition at line 2716 of file integer.cpp.
Referenced by CleanUp(), Tsman::execDUMP_STATE_ORD(), read__fixio(), and TaoCrypt::Integer::Zero().
Integer* TaoCrypt::one = 0 [static] |
Definition at line 2726 of file integer.cpp.
Referenced by CleanUp(), TaoCrypt::Integer::One(), and run_query_stmt().
1.4.7

