From: Jacek S. <arn...@us...> - 2006-02-19 16:51:44
|
Update of /cvsroot/dcplusplus/dcplusplus/yassl/taocrypt/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25210/yassl/taocrypt/include Modified Files: misc.hpp hash.hpp block.hpp asn.hpp Log Message: yassl update, installer fix Index: misc.hpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/yassl/taocrypt/include/misc.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** misc.hpp 27 Nov 2005 19:19:19 -0000 1.1 --- misc.hpp 19 Feb 2006 16:51:07 -0000 1.2 *************** *** 41,85 **** namespace TaoCrypt { ! // library allocation ! struct new_t {}; // TaoCrypt New type ! extern new_t tc; // pass in parameter ! } // namespace TaoCrypt ! void* operator new (size_t, TaoCrypt::new_t); ! void* operator new[](size_t, TaoCrypt::new_t); ! void operator delete (void*, TaoCrypt::new_t); ! void operator delete[](void*, TaoCrypt::new_t); - namespace TaoCrypt { ! template<typename T> ! void tcDelete(T* ptr) ! { ! if (ptr) ptr->~T(); ! ::operator delete(ptr, TaoCrypt::tc); ! } ! template<typename T> ! void tcArrayDelete(T* ptr) ! { ! // can't do array placement destruction since not tracking size in ! // allocation, only allow builtins to use array placement since they ! // don't need destructors called ! typedef char builtin[IsFundamentalType<T>::Yes ? 1 : -1]; ! (void)sizeof(builtin); ! ::operator delete[](ptr, TaoCrypt::tc); ! } ! // to resolve compiler generated operator delete on base classes with ! // virtual destructors (when on stack), make sure doesn't get called ! class virtual_base { ! public: ! static void operator delete(void*) { assert(0); } ! }; --- 41,111 ---- namespace TaoCrypt { ! #ifdef YASSL_PURE_C ! // library allocation ! struct new_t {}; // TaoCrypt New type ! extern new_t tc; // pass in parameter ! } // namespace TaoCrypt ! void* operator new (size_t, TaoCrypt::new_t); ! void* operator new[](size_t, TaoCrypt::new_t); + void operator delete (void*, TaoCrypt::new_t); + void operator delete[](void*, TaoCrypt::new_t); ! namespace TaoCrypt { ! template<typename T> ! void tcDelete(T* ptr) ! { ! if (ptr) ptr->~T(); ! ::operator delete(ptr, TaoCrypt::tc); ! } ! template<typename T> ! void tcArrayDelete(T* ptr) ! { ! // can't do array placement destruction since not tracking size in ! // allocation, only allow builtins to use array placement since they ! // don't need destructors called ! typedef char builtin[IsFundamentalType<T>::Yes ? 1 : -1]; ! (void)sizeof(builtin); ! ! ::operator delete[](ptr, TaoCrypt::tc); ! } + #define NEW_TC new (tc) ! ! // to resolve compiler generated operator delete on base classes with ! // virtual destructors (when on stack), make sure doesn't get called ! class virtual_base { ! public: ! static void operator delete(void*) { assert(0); } ! }; ! ! #else // YASSL_PURE_C ! ! ! template<typename T> ! void tcDelete(T* ptr) ! { ! delete ptr; ! } ! ! template<typename T> ! void tcArrayDelete(T* ptr) ! { ! delete[] ptr; ! } ! ! #define NEW_TC new ! ! class virtual_base {}; ! ! ! #endif // YASSL_PURE_C *************** *** 113,123 **** // Turn on ia32 ASM for Ciphers and Message Digests ! // For GCC user has to enable during ./configure because of problems with ! // intel syntax addressing on older gas versions ! #if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(_MSC_VER) #define TAO_ASM #endif #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # define TAOCRYPT_MALLOC_ALIGNMENT_IS_16 --- 139,155 ---- // Turn on ia32 ASM for Ciphers and Message Digests ! // Seperate define since these are more complex, use member offsets ! // and user may want to turn off while leaving Big Integer optos on ! #if defined(TAOCRYPT_X86ASM_AVAILABLE) && !defined(DISABLE_TAO_ASM) #define TAO_ASM #endif + // Extra word in older vtable implementations, for ASM member offset + #if defined(__GNUC__) && __GNUC__ < 3 + #define OLD_GCC_OFFSET + #endif + + #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # define TAOCRYPT_MALLOC_ALIGNMENT_IS_16 Index: asn.hpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/yassl/taocrypt/include/asn.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** asn.hpp 27 Nov 2005 19:19:19 -0000 1.1 --- asn.hpp 19 Feb 2006 16:51:07 -0000 1.2 *************** *** 185,189 **** public: explicit PublicKey(const byte* k = 0, word32 s = 0); ! ~PublicKey() { tcArrayDelete(key_); } const byte* GetKey() const { return key_; } --- 185,189 ---- public: explicit PublicKey(const byte* k = 0, word32 s = 0); ! ~PublicKey() { tcDelete(key_); } const byte* GetKey() const { return key_; } *************** *** 238,242 **** explicit CertDecoder(Source&, bool decode = true, SignerList* sl = 0, ! CertType ct = USER); ~CertDecoder(); --- 238,242 ---- explicit CertDecoder(Source&, bool decode = true, SignerList* sl = 0, ! bool noVerify = false, CertType ct = USER); ~CertDecoder(); *************** *** 260,263 **** --- 260,264 ---- char* issuer_; // CommonName char* subject_; // CommonName + bool verify_; // Default to yes, but could be off void ReadHeader(); Index: block.hpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/yassl/taocrypt/include/block.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** block.hpp 27 Nov 2005 19:19:19 -0000 1.1 --- block.hpp 19 Feb 2006 16:51:07 -0000 1.2 *************** *** 100,104 **** if (n == 0) return 0; ! return new T[n]; } --- 100,104 ---- if (n == 0) return 0; ! return NEW_TC T[n]; } Index: hash.hpp =================================================================== RCS file: /cvsroot/dcplusplus/dcplusplus/yassl/taocrypt/include/hash.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hash.hpp 27 Nov 2005 19:19:19 -0000 1.1 --- hash.hpp 19 Feb 2006 16:51:07 -0000 1.2 *************** *** 77,80 **** --- 77,81 ---- + } // namespace |