diff options
author | unknown <svoj@mysql.com> | 2005-07-01 20:00:59 +0500 |
---|---|---|
committer | unknown <svoj@mysql.com> | 2005-07-01 20:00:59 +0500 |
commit | 672dffcaf24332626cd3abe8f4366c7c66382d43 (patch) | |
tree | 50a170b168a3f21cd4cf1e5a5c1cebfa3b8f1cdd /extra/yassl/taocrypt/src | |
parent | 6c8d397588722dece2803370409d4776d5ffb461 (diff) | |
download | mariadb-git-672dffcaf24332626cd3abe8f4366c7c66382d43.tar.gz |
WL#2286 - Compile MySQL w/YASSL support
Merge with latest yaSSL. It includes fix for bigendian/littleendian
problem (fixes func_encrypt test failure). Our trees are in sync now.
extra/yassl/include/yassl_types.hpp:
Merge with latest yaSSL.
extra/yassl/src/Makefile.am:
Merge with latest yaSSL.
extra/yassl/src/buffer.cpp:
Merge with latest yaSSL.
extra/yassl/src/cert_wrapper.cpp:
Merge with latest yaSSL.
extra/yassl/src/lock.cpp:
Merge with latest yaSSL.
extra/yassl/src/log.cpp:
Merge with latest yaSSL.
extra/yassl/src/socket_wrapper.cpp:
Merge with latest yaSSL.
extra/yassl/src/template_instnt.cpp:
Merge with latest yaSSL.
extra/yassl/src/timer.cpp:
Merge with latest yaSSL.
extra/yassl/src/yassl_error.cpp:
Merge with latest yaSSL.
extra/yassl/src/yassl_int.cpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/include/types.hpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/Makefile.am:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/aestables.cpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/algebra.cpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/arc4.cpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/coding.cpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/file.cpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/integer.cpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/misc.cpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/random.cpp:
Merge with latest yaSSL.
extra/yassl/taocrypt/src/template_instnt.cpp:
Merge with latest yaSSL.
Diffstat (limited to 'extra/yassl/taocrypt/src')
-rw-r--r-- | extra/yassl/taocrypt/src/Makefile.am | 1 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/aestables.cpp | 1 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/algebra.cpp | 2 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/arc4.cpp | 1 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/coding.cpp | 1 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/file.cpp | 1 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/integer.cpp | 6 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/misc.cpp | 27 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/random.cpp | 1 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/template_instnt.cpp | 30 |
10 files changed, 60 insertions, 11 deletions
diff --git a/extra/yassl/taocrypt/src/Makefile.am b/extra/yassl/taocrypt/src/Makefile.am index 4005be94fb2..5bf45074a98 100644 --- a/extra/yassl/taocrypt/src/Makefile.am +++ b/extra/yassl/taocrypt/src/Makefile.am @@ -6,3 +6,4 @@ libtaocrypt_a_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp asn.cpp \ md2.cpp md5.cpp misc.cpp random.cpp ripemd.cpp rsa.cpp sha.cpp \ template_instnt.cpp EXTRA_DIST = ../include/*.hpp +AM_CXXFLAGS = -DYASSL_PURE_C diff --git a/extra/yassl/taocrypt/src/aestables.cpp b/extra/yassl/taocrypt/src/aestables.cpp index 5a125dfd44d..7ba25bc9ffb 100644 --- a/extra/yassl/taocrypt/src/aestables.cpp +++ b/extra/yassl/taocrypt/src/aestables.cpp @@ -21,6 +21,7 @@ /* based on Wei Dai's aestables.cpp from CryptoPP */ +#include "runtime.hpp" #include "aes.hpp" diff --git a/extra/yassl/taocrypt/src/algebra.cpp b/extra/yassl/taocrypt/src/algebra.cpp index e0472f2fc76..45bbcfa662a 100644 --- a/extra/yassl/taocrypt/src/algebra.cpp +++ b/extra/yassl/taocrypt/src/algebra.cpp @@ -319,9 +319,11 @@ void AbstractRing::SimultaneousExponentiate(Integer *results, } // namespace + #ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION namespace mySTL { template TaoCrypt::WindowSlider* uninit_copy<TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*); template void destroy<TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*); } #endif + diff --git a/extra/yassl/taocrypt/src/arc4.cpp b/extra/yassl/taocrypt/src/arc4.cpp index bbd77cd822c..1e521b48f0c 100644 --- a/extra/yassl/taocrypt/src/arc4.cpp +++ b/extra/yassl/taocrypt/src/arc4.cpp @@ -21,6 +21,7 @@ /* based on Wei Dai's arc4.cpp from CryptoPP */ +#include "runtime.hpp" #include "arc4.hpp" diff --git a/extra/yassl/taocrypt/src/coding.cpp b/extra/yassl/taocrypt/src/coding.cpp index 6514ed4d46d..944a47c288e 100644 --- a/extra/yassl/taocrypt/src/coding.cpp +++ b/extra/yassl/taocrypt/src/coding.cpp @@ -22,6 +22,7 @@ /* coding.cpp implements hex and base64 encoding/decoing */ +#include "runtime.hpp" #include "coding.hpp" #include "file.hpp" diff --git a/extra/yassl/taocrypt/src/file.cpp b/extra/yassl/taocrypt/src/file.cpp index 75df80608ae..4d48b9e7bca 100644 --- a/extra/yassl/taocrypt/src/file.cpp +++ b/extra/yassl/taocrypt/src/file.cpp @@ -22,6 +22,7 @@ /* file.cpp implements File Sources and Sinks */ +#include "runtime.hpp" #include "file.hpp" diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp index 460b2d31426..71324b04b92 100644 --- a/extra/yassl/taocrypt/src/integer.cpp +++ b/extra/yassl/taocrypt/src/integer.cpp @@ -35,8 +35,9 @@ #endif -#if defined(_MSC_VER) && defined(_WIN64) && \ - !defined(__INTEL_COMPILER) // 64 bit X overflow intrinsic +// 64bit multiply overflow intrinsic +#if defined(_MSC_VER) && defined(_WIN64) && !defined(__INTEL_COMPILER) && \ + !defined(TAOCRYPT_NATIVE_DWORD_AVAILABLE) #ifdef __ia64__ #define myUMULH __UMULH #elif __x86_64__ @@ -3957,6 +3958,7 @@ Integer CRT(const Integer &xp, const Integer &p, const Integer &xq, return p * (u * (xq-xp) % q) + xp; } + #ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION #ifndef TAOCRYPT_NATIVE_DWORD_AVAILABLE template hword DivideThreeWordsByTwo<hword, Word>(hword*, hword, hword, Word*); diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp index 6a801a9995a..ef051332098 100644 --- a/extra/yassl/taocrypt/src/misc.cpp +++ b/extra/yassl/taocrypt/src/misc.cpp @@ -22,34 +22,43 @@ /* based on Wei Dai's misc.cpp from CryptoPP */ +#include "runtime.hpp" #include "misc.hpp" #include <new> // for NewHandler void* operator new(size_t sz, TaoCrypt::new_t) { +#ifdef YASSL_PURE_C void* ptr = malloc(sz ? sz : 1); if (!ptr) abort(); return ptr; +#else + return ::operator new(sz); +#endif } -void* operator new[](size_t sz, TaoCrypt::new_t) -{ - void* ptr = malloc(sz ? sz : 1); - if (!ptr) abort(); - - return ptr; -} void operator delete(void* ptr, TaoCrypt::new_t) { +#ifdef YASSL_PURE_C if (ptr) free(ptr); +#else + ::operator delete(ptr); +#endif } -void operator delete[](void* ptr, TaoCrypt::new_t) + +void* operator new[](size_t sz, TaoCrypt::new_t nt) { - if (ptr) free(ptr); + return ::operator new(sz, nt); +} + + +void operator delete[](void* ptr, TaoCrypt::new_t nt) +{ + ::operator delete(ptr, nt); } diff --git a/extra/yassl/taocrypt/src/random.cpp b/extra/yassl/taocrypt/src/random.cpp index 69fb180720a..e1e6416eb00 100644 --- a/extra/yassl/taocrypt/src/random.cpp +++ b/extra/yassl/taocrypt/src/random.cpp @@ -24,6 +24,7 @@ specific seed, switch to /dev/random for more security but may block */ +#include "runtime.hpp" #include "random.hpp" #if defined(_WIN32) diff --git a/extra/yassl/taocrypt/src/template_instnt.cpp b/extra/yassl/taocrypt/src/template_instnt.cpp index 28994282669..9a3c12badfc 100644 --- a/extra/yassl/taocrypt/src/template_instnt.cpp +++ b/extra/yassl/taocrypt/src/template_instnt.cpp @@ -1,3 +1,29 @@ +/* template_instnt.cpp + * + * Copyright (C) 2003 Sawtooth Consulting Ltd. + * + * This file is part of yaSSL. + * + * yaSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * yaSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/* Explicit template instantiation requests + */ + + #include "integer.hpp" #include "rsa.hpp" #include "algebra.hpp" @@ -6,9 +32,11 @@ #ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION namespace TaoCrypt { + #if defined(SSE2_INTRINSICS_AVAILABLE) template AlignedAllocator<unsigned int>::pointer StdReallocate<unsigned int, AlignedAllocator<unsigned int> >(AlignedAllocator<unsigned int>&, unsigned int*, AlignedAllocator<unsigned int>::size_type, AlignedAllocator<unsigned int>::size_type, bool); #endif + template class RSA_Decryptor<RSA_BlockType2>; template class RSA_Encryptor<RSA_BlockType1>; template class RSA_Encryptor<RSA_BlockType2>; @@ -17,10 +45,12 @@ template void tcArrayDelete<byte>(byte*); template AllocatorWithCleanup<byte>::pointer StdReallocate<byte, AllocatorWithCleanup<byte> >(AllocatorWithCleanup<byte>&, byte*, AllocatorWithCleanup<byte>::size_type, AllocatorWithCleanup<byte>::size_type, bool); template void tcArrayDelete<word>(word*); template AllocatorWithCleanup<word>::pointer StdReallocate<word, AllocatorWithCleanup<word> >(AllocatorWithCleanup<word>&, word*, AllocatorWithCleanup<word>::size_type, AllocatorWithCleanup<word>::size_type, bool); + #ifndef TAOCRYPT_SLOW_WORD64 // defined when word != word32 template void tcArrayDelete<word32>(word32*); template AllocatorWithCleanup<word32>::pointer StdReallocate<word32, AllocatorWithCleanup<word32> >(AllocatorWithCleanup<word32>&, word32*, AllocatorWithCleanup<word32>::size_type, AllocatorWithCleanup<word32>::size_type, bool); #endif + template void tcArrayDelete<char>(char*); } |