/[mldonkey]/mldonkey/src/utils/lib/CryptoPP.h
ViewVC logotype

Diff of /mldonkey/src/utils/lib/CryptoPP.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by spiralvoice, Wed Nov 30 23:46:25 2005 UTC revision 1.4 by spiralvoice, Fri Dec 2 12:01:44 2005 UTC
# Line 272  NAMESPACE_END Line 272  NAMESPACE_END
272    
273  // CodeWarrior defines _MSC_VER  // CodeWarrior defines _MSC_VER
274  #if !defined(CRYPTOPP_DISABLE_X86ASM) && ((defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86)) || (defined(__GNUC__) && defined(__i386__)))  #if !defined(CRYPTOPP_DISABLE_X86ASM) && ((defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86)) || (defined(__GNUC__) && defined(__i386__)))
275  #define CRYPTOPP_X86ASM_AVAILABLE          // The x86 version of MacOSX fails when asm is enabled.
276            #if !defined(__i386__) || !defined(__APPLE__)
277                    #define CRYPTOPP_X86ASM_AVAILABLE
278            #endif
279  #endif  #endif
280    
281  // ***************** determine availability of OS features ********************  // ***************** determine availability of OS features ********************
# Line 1920  inline T RoundUpToMultipleOf(T n, T m) Line 1923  inline T RoundUpToMultipleOf(T n, T m)
1923  template <class T>  template <class T>
1924  inline unsigned int GetAlignment(T* /* dummy */ = NULL) // VC60 workaround  inline unsigned int GetAlignment(T* /* dummy */ = NULL) // VC60 workaround
1925  {  {
1926  #if (_MSC_VER >= 1300)  #if defined(_MSC_VER) and (_MSC_VER >= 1300)
1927          return __alignof(T);          return __alignof(T);
1928  #elif defined(__GNUC__)  #elif defined(__GNUC__)
1929          return __alignof__(T);          return __alignof__(T);
# Line 2717  template <class T, class A = AllocatorWi Line 2720  template <class T, class A = AllocatorWi
2720  class SecBlock  class SecBlock
2721  {  {
2722  public:  public:
2723      explicit SecBlock(unsigned int size=0)      explicit SecBlock(unsigned int blocksize=0)
2724                  : m_size(size) {m_ptr = m_alloc.allocate(size, NULL);}                  : m_size(blocksize) {m_ptr = m_alloc.allocate(blocksize, NULL);}
2725          SecBlock(const SecBlock<T, A> &t)          SecBlock(const SecBlock<T, A> &t)
2726                  : m_size(t.m_size) {m_ptr = m_alloc.allocate(m_size, NULL); memcpy(m_ptr, t.m_ptr, m_size*sizeof(T));}                  : m_size(t.m_size) {m_ptr = m_alloc.allocate(m_size, NULL); memcpy(m_ptr, t.m_ptr, m_size*sizeof(T));}
2727          SecBlock(const T *t, unsigned int len)          SecBlock(const T *t, unsigned int len)
# Line 2935  NAMESPACE_END Line 2938  NAMESPACE_END
2938  #endif  #endif
2939    
2940  // SSE2 intrinsics work in GCC 3.3 or later  // SSE2 intrinsics work in GCC 3.3 or later
2941  #if defined(__SSE2__) && (__GNUC_MAJOR__ > 3 || __GNUC_MINOR__ > 2)  #if defined(__SSE2__) && (__GNUC__ > 3 || __GNUC_MINOR__ > 2)
2942          #define SSE2_INTRINSICS_AVAILABLE          #define SSE2_INTRINSICS_AVAILABLE
2943  #endif  #endif
2944    
# Line 3599  public: Line 3602  public:
3602          typedef int RandomizationParameter;          typedef int RandomizationParameter;
3603          typedef Integer Element;          typedef Integer Element;
3604    
3605          ModularArithmetic(const Integer &modulus = Integer::One())          ModularArithmetic(const Integer &mod = Integer::One())
3606                  : AbstractRing<Integer>(),                  : AbstractRing<Integer>(),
3607                    modulus(modulus), result((word)0, modulus.reg.size()) {}                    modulus(mod), result((word)0, modulus.reg.size()) {}
3608    
3609          ModularArithmetic(const ModularArithmetic &ma)          ModularArithmetic(const ModularArithmetic &ma)
3610                  : AbstractRing<Integer>(),                  : AbstractRing<Integer>(),
# Line 4077  public: Line 4080  public:
4080          {          {
4081                  Assign((const byte *)data, data ? strlen(data) : 0, deepCopy);                  Assign((const byte *)data, data ? strlen(data) : 0, deepCopy);
4082          }          }
4083          ConstByteArrayParameter(const byte *data, unsigned int size, bool deepCopy = false)          ConstByteArrayParameter(const byte *data, unsigned int datasize, bool deepCopy = false)
4084          {          {
4085                  Assign(data, size, deepCopy);                  Assign(data, datasize, deepCopy);
4086          }          }
4087          template <class T> ConstByteArrayParameter(const T &string, bool deepCopy = false)          template <class T> ConstByteArrayParameter(const T &string, bool deepCopy = false)
4088          {          {
# Line 4087  public: Line 4090  public:
4090                  Assign((const byte *)string.data(), string.size(), deepCopy);                  Assign((const byte *)string.data(), string.size(), deepCopy);
4091          }          }
4092    
4093          void Assign(const byte *data, unsigned int size, bool deepCopy)          void Assign(const byte *data, unsigned int datasize, bool deepCopy)
4094          {          {
4095                  if (deepCopy)                  if (deepCopy)
4096                          m_block.Assign(data, size);                          m_block.Assign(data, datasize);
4097                  else                  else
4098                  {                  {
4099                          m_data = data;                          m_data = data;
4100                          m_size = size;                          m_size = datasize;
4101                  }                  }
4102                  m_deepCopy = deepCopy;                  m_deepCopy = deepCopy;
4103          }          }
# Line 4113  private: Line 4116  private:
4116  class ByteArrayParameter  class ByteArrayParameter
4117  {  {
4118  public:  public:
4119          ByteArrayParameter(byte *data = NULL, unsigned int size = 0)          ByteArrayParameter(byte *data = NULL, unsigned int datasize = 0)
4120                  : m_data(data), m_size(size) {}                  : m_data(data), m_size(datasize) {}
4121          ByteArrayParameter(SecByteBlock &block)          ByteArrayParameter(SecByteBlock &block)
4122                  : m_data(block.begin()), m_size(block.size()) {}                  : m_data(block.begin()), m_size(block.size()) {}
4123    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26