Prefer C++11 interfaces over tr1 for libc++ and C++11.
This commit is contained in:
parent
44a452aa70
commit
4c9e44dac9
16 changed files with 551 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: distinfo,v 1.12 2012/10/08 20:46:38 pettai Exp $
|
||||
$NetBSD: distinfo,v 1.13 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
SHA1 (Botan-1.8.14.tgz) = a845a5e6d0386e0bdbd7a8cfc646d5a4cdec8649
|
||||
RMD160 (Botan-1.8.14.tgz) = 6125937c13860b67a18dbbee71c477b4d06ad5b2
|
||||
|
@ -6,5 +6,20 @@ Size (Botan-1.8.14.tgz) = 2632909 bytes
|
|||
SHA1 (patch-ab) = a53a3e23722d8f478c5a6c5ecf1df08d74fd21c0
|
||||
SHA1 (patch-ac) = 4f98ff086983b27ed17d048486a8afced47e7970
|
||||
SHA1 (patch-ak) = 7bf66c1faa84971b490be96efefac0ef44f97b70
|
||||
SHA1 (patch-src_cert_cvc_cvc__ado.cpp) = 94c632fcdf6d8df903135c7abe9bb26ab194f803
|
||||
SHA1 (patch-src_cert_cvc_cvc__ado.h) = b10593175baf2787b5522a05369773877c135a8a
|
||||
SHA1 (patch-src_cert_cvc_cvc__ca.cpp) = 2bd37cbd9432d605b1306d43612e35a37565d490
|
||||
SHA1 (patch-src_cert_cvc_cvc__cert.cpp) = 4cac9f415e1e60b04b97ba8fbb29d891f08cbab9
|
||||
SHA1 (patch-src_cert_cvc_cvc__cert.h) = de72a3c9a4f1d6eb107ff07f209516e9ffca8e1c
|
||||
SHA1 (patch-src_cert_cvc_cvc__req.cpp) = 576d874e570a271ffb3ac81e57890401d900583a
|
||||
SHA1 (patch-src_cert_cvc_cvc__req.h) = 419916c1b2089e27d5e9f2a2f714793e6fcc1809
|
||||
SHA1 (patch-src_cert_cvc_cvc__self.cpp) = 251a097a699633e3537cc87c28aeed41e885344f
|
||||
SHA1 (patch-src_cert_cvc_freestore.h) = 620892af8b6caf688c1c1789acd2a2f712f5d441
|
||||
SHA1 (patch-src_entropy_unix_procs_info.txt) = c2685db5fbd16a67b008b738730518858265ebc0
|
||||
SHA1 (patch-src_hash_sha1_amd64_info.txt) = d83a7b88b5860a596607e529b29090afa16dcda7
|
||||
SHA1 (patch-src_math_gfpmath_curve__gfp.cpp) = 4a24c751bc5a8ae049b633b0ac2fcb48a6f606ff
|
||||
SHA1 (patch-src_math_gfpmath_curve__gfp.h) = f0338064ba2dda12c36af9ad18d3a036f99fea50
|
||||
SHA1 (patch-src_math_gfpmath_gfp__element.cpp) = 6b787da2e8d9d3e6d00c3a4d3de907d0466dbfbc
|
||||
SHA1 (patch-src_math_gfpmath_gfp__element.h) = 59bf2a7d1ccde428e5c42977f1185e4b15c2d02f
|
||||
SHA1 (patch-src_math_gfpmath_point__gfp.cpp) = e9727610d64b103991f2b5ce82de26627e8e02f6
|
||||
SHA1 (patch-src_math_gfpmath_point__gfp.h) = 3b2b93e11cb0b49bfb983147d36259060daff782
|
||||
|
|
31
security/botan/patches/patch-src_cert_cvc_cvc__ado.cpp
Normal file
31
security/botan/patches/patch-src_cert_cvc_cvc__ado.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
$NetBSD: patch-src_cert_cvc_cvc__ado.cpp,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/cert/cvc/cvc_ado.cpp.orig 2013-04-30 23:02:37.000000000 +0000
|
||||
+++ src/cert/cvc/cvc_ado.cpp
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace Botan {
|
||||
|
||||
-EAC1_1_ADO::EAC1_1_ADO(std::tr1::shared_ptr<DataSource> in)
|
||||
+EAC1_1_ADO::EAC1_1_ADO(shared_ptr<DataSource> in)
|
||||
{
|
||||
init(in);
|
||||
do_decode();
|
||||
@@ -20,7 +20,7 @@ EAC1_1_ADO::EAC1_1_ADO(std::tr1::shared_
|
||||
|
||||
EAC1_1_ADO::EAC1_1_ADO(const std::string& in)
|
||||
{
|
||||
- std::tr1::shared_ptr<DataSource> stream(new DataSource_Stream(in, true));
|
||||
+ shared_ptr<DataSource> stream(new DataSource_Stream(in, true));
|
||||
init(stream);
|
||||
do_decode();
|
||||
}
|
||||
@@ -41,7 +41,7 @@ void EAC1_1_ADO::force_decode()
|
||||
.end_cons()
|
||||
.get_contents();
|
||||
|
||||
- std::tr1::shared_ptr<DataSource> req_source(new DataSource_Memory(req_bits));
|
||||
+ shared_ptr<DataSource> req_source(new DataSource_Memory(req_bits));
|
||||
m_req = EAC1_1_Req(req_source);
|
||||
sig_algo = m_req.sig_algo;
|
||||
}
|
13
security/botan/patches/patch-src_cert_cvc_cvc__ado.h
Normal file
13
security/botan/patches/patch-src_cert_cvc_cvc__ado.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
$NetBSD: patch-src_cert_cvc_cvc__ado.h,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/cert/cvc/cvc_ado.h.orig 2013-04-30 23:02:27.000000000 +0000
|
||||
+++ src/cert/cvc/cvc_ado.h
|
||||
@@ -39,7 +39,7 @@ class BOTAN_DLL EAC1_1_ADO : public EAC1
|
||||
* Construct a CVC ADO request from a data source
|
||||
* @param source the data source
|
||||
*/
|
||||
- EAC1_1_ADO(std::tr1::shared_ptr<DataSource> source);
|
||||
+ EAC1_1_ADO(shared_ptr<DataSource> source);
|
||||
|
||||
/**
|
||||
* Create a signed CVC ADO request from to be signed (TBS) data
|
13
security/botan/patches/patch-src_cert_cvc_cvc__ca.cpp
Normal file
13
security/botan/patches/patch-src_cert_cvc_cvc__ca.cpp
Normal file
|
@ -0,0 +1,13 @@
|
|||
$NetBSD: patch-src_cert_cvc_cvc__ca.cpp,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/cert/cvc/cvc_ca.cpp.orig 2013-04-30 23:02:49.000000000 +0000
|
||||
+++ src/cert/cvc/cvc_ca.cpp
|
||||
@@ -38,7 +38,7 @@ EAC1_1_CVC EAC1_1_CVC_CA::make_cert(std:
|
||||
EAC1_1_CVC::build_cert_body(tbs),
|
||||
rng);
|
||||
|
||||
- std::tr1::shared_ptr<DataSource> source(new DataSource_Memory(signed_cert));
|
||||
+ shared_ptr<DataSource> source(new DataSource_Memory(signed_cert));
|
||||
|
||||
return EAC1_1_CVC(source);
|
||||
}
|
22
security/botan/patches/patch-src_cert_cvc_cvc__cert.cpp
Normal file
22
security/botan/patches/patch-src_cert_cvc_cvc__cert.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
$NetBSD: patch-src_cert_cvc_cvc__cert.cpp,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/cert/cvc/cvc_cert.cpp.orig 2013-04-30 23:03:08.000000000 +0000
|
||||
+++ src/cert/cvc/cvc_cert.cpp
|
||||
@@ -78,7 +78,7 @@ void EAC1_1_CVC::force_decode()
|
||||
/*
|
||||
* CVC Certificate Constructor
|
||||
*/
|
||||
-EAC1_1_CVC::EAC1_1_CVC(std::tr1::shared_ptr<DataSource>& in)
|
||||
+EAC1_1_CVC::EAC1_1_CVC(shared_ptr<DataSource>& in)
|
||||
{
|
||||
init(in);
|
||||
self_signed = false;
|
||||
@@ -87,7 +87,7 @@ EAC1_1_CVC::EAC1_1_CVC(std::tr1::shared_
|
||||
|
||||
EAC1_1_CVC::EAC1_1_CVC(const std::string& in)
|
||||
{
|
||||
- std::tr1::shared_ptr<DataSource> stream(new DataSource_Stream(in, true));
|
||||
+ shared_ptr<DataSource> stream(new DataSource_Stream(in, true));
|
||||
init(stream);
|
||||
self_signed = false;
|
||||
do_decode();
|
13
security/botan/patches/patch-src_cert_cvc_cvc__cert.h
Normal file
13
security/botan/patches/patch-src_cert_cvc_cvc__cert.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
$NetBSD: patch-src_cert_cvc_cvc__cert.h,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/cert/cvc/cvc_cert.h.orig 2013-04-30 23:03:11.000000000 +0000
|
||||
+++ src/cert/cvc/cvc_cert.h
|
||||
@@ -59,7 +59,7 @@ class BOTAN_DLL EAC1_1_CVC : public EAC1
|
||||
* Construct a CVC from a data source
|
||||
* @param source the data source
|
||||
*/
|
||||
- EAC1_1_CVC(std::tr1::shared_ptr<DataSource>& source);
|
||||
+ EAC1_1_CVC(shared_ptr<DataSource>& source);
|
||||
|
||||
/**
|
||||
* Construct a CVC from a file
|
22
security/botan/patches/patch-src_cert_cvc_cvc__req.cpp
Normal file
22
security/botan/patches/patch-src_cert_cvc_cvc__req.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
$NetBSD: patch-src_cert_cvc_cvc__req.cpp,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/cert/cvc/cvc_req.cpp.orig 2013-04-30 23:48:36.000000000 +0000
|
||||
+++ src/cert/cvc/cvc_req.cpp
|
||||
@@ -50,7 +50,7 @@ void EAC1_1_Req::force_decode()
|
||||
#endif
|
||||
}
|
||||
|
||||
-EAC1_1_Req::EAC1_1_Req(std::tr1::shared_ptr<DataSource> in)
|
||||
+EAC1_1_Req::EAC1_1_Req(shared_ptr<DataSource> in)
|
||||
{
|
||||
init(in);
|
||||
self_signed = true;
|
||||
@@ -59,7 +59,7 @@ EAC1_1_Req::EAC1_1_Req(std::tr1::shared_
|
||||
|
||||
EAC1_1_Req::EAC1_1_Req(const std::string& in)
|
||||
{
|
||||
- std::tr1::shared_ptr<DataSource> stream(new DataSource_Stream(in, true));
|
||||
+ shared_ptr<DataSource> stream(new DataSource_Stream(in, true));
|
||||
init(stream);
|
||||
self_signed = true;
|
||||
do_decode();
|
13
security/botan/patches/patch-src_cert_cvc_cvc__req.h
Normal file
13
security/botan/patches/patch-src_cert_cvc_cvc__req.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
$NetBSD: patch-src_cert_cvc_cvc__req.h,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/cert/cvc/cvc_req.h.orig 2013-04-30 23:01:50.000000000 +0000
|
||||
+++ src/cert/cvc/cvc_req.h
|
||||
@@ -36,7 +36,7 @@ class BOTAN_DLL EAC1_1_Req : public EAC1
|
||||
* Construct a CVC request from a data source.
|
||||
* @param source the data source
|
||||
*/
|
||||
- EAC1_1_Req(std::tr1::shared_ptr<DataSource> source);
|
||||
+ EAC1_1_Req(shared_ptr<DataSource> source);
|
||||
|
||||
/**
|
||||
* Construct a CVC request from a DER encoded CVC reqeust file.
|
22
security/botan/patches/patch-src_cert_cvc_cvc__self.cpp
Normal file
22
security/botan/patches/patch-src_cert_cvc_cvc__self.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
$NetBSD: patch-src_cert_cvc_cvc__self.cpp,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/cert/cvc/cvc_self.cpp.orig 2013-04-30 23:02:54.000000000 +0000
|
||||
+++ src/cert/cvc/cvc_self.cpp
|
||||
@@ -131,7 +131,7 @@ EAC1_1_Req create_cvc_req(Private_Key co
|
||||
.get_contents();
|
||||
|
||||
MemoryVector<byte> signed_cert = EAC1_1_gen_CVC<EAC1_1_Req>::make_signed(signer, EAC1_1_gen_CVC<EAC1_1_Req>::build_cert_body(tbs), rng);
|
||||
- std::tr1::shared_ptr<DataSource> source(new DataSource_Memory(signed_cert));
|
||||
+ shared_ptr<DataSource> source(new DataSource_Memory(signed_cert));
|
||||
return EAC1_1_Req(source);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ EAC1_1_ADO create_ado_req(Private_Key co
|
||||
SecureVector<byte> tbs_bits = req.BER_encode();
|
||||
tbs_bits.append(DER_Encoder().encode(car).get_contents());
|
||||
MemoryVector<byte> signed_cert = EAC1_1_ADO::make_signed(signer, tbs_bits, rng);
|
||||
- std::tr1::shared_ptr<DataSource> source(new DataSource_Memory(signed_cert));
|
||||
+ shared_ptr<DataSource> source(new DataSource_Memory(signed_cert));
|
||||
return EAC1_1_ADO(source);
|
||||
}
|
||||
|
39
security/botan/patches/patch-src_cert_cvc_freestore.h
Normal file
39
security/botan/patches/patch-src_cert_cvc_freestore.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
$NetBSD: patch-src_cert_cvc_freestore.h,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/cert/cvc/freestore.h.orig 2013-04-30 22:56:51.000000000 +0000
|
||||
+++ src/cert/cvc/freestore.h
|
||||
@@ -8,7 +8,9 @@
|
||||
|
||||
#include <botan/build.h>
|
||||
|
||||
-#if defined(BOTAN_USE_STD_TR1)
|
||||
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
|
||||
+ #include <memory>
|
||||
+#elif defined(BOTAN_USE_STD_TR1)
|
||||
#include <tr1/memory>
|
||||
#elif defined(BOTAN_USE_BOOST_TR1)
|
||||
#include <boost/tr1/memory.hpp>
|
||||
@@ -17,6 +19,14 @@
|
||||
#endif
|
||||
|
||||
namespace Botan {
|
||||
+#ifndef BOTAN_SHARED_PTR
|
||||
+#define BOTAN_SHARED_PTR
|
||||
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
|
||||
+ using std::shared_ptr;
|
||||
+#else
|
||||
+ using std::tr1::shared_ptr;
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
/**
|
||||
* This class is intended as an function call parameter type and
|
||||
@@ -30,7 +40,7 @@ template<typename T>
|
||||
class BOTAN_DLL SharedPtrConverter
|
||||
{
|
||||
public:
|
||||
- typedef std::tr1::shared_ptr<T> SharedPtr;
|
||||
+ typedef shared_ptr<T> SharedPtr;
|
||||
|
||||
/**
|
||||
* Construct a null pointer equivalent object.
|
105
security/botan/patches/patch-src_math_gfpmath_curve__gfp.cpp
Normal file
105
security/botan/patches/patch-src_math_gfpmath_curve__gfp.cpp
Normal file
|
@ -0,0 +1,105 @@
|
|||
$NetBSD: patch-src_math_gfpmath_curve__gfp.cpp,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/math/gfpmath/curve_gfp.cpp.orig 2013-04-30 23:08:27.000000000 +0000
|
||||
+++ src/math/gfpmath/curve_gfp.cpp
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
namespace Botan {
|
||||
|
||||
-void CurveGFp::set_shrd_mod(const std::tr1::shared_ptr<GFpModulus> mod)
|
||||
+void CurveGFp::set_shrd_mod(const shared_ptr<GFpModulus> mod)
|
||||
{
|
||||
mp_mod = mod;
|
||||
mA.turn_off_sp_red_mul();// m.m. is not needed, must be trf. back
|
||||
@@ -34,7 +34,7 @@ CurveGFp::CurveGFp(const GFpElement& a,
|
||||
{
|
||||
throw Invalid_Argument("could not construct curve: moduli of arguments differ");
|
||||
}
|
||||
- std::tr1::shared_ptr<GFpModulus> p_mod = std::tr1::shared_ptr<GFpModulus>(new GFpModulus(p));
|
||||
+ shared_ptr<GFpModulus> p_mod = shared_ptr<GFpModulus>(new GFpModulus(p));
|
||||
// the above is the creation of the GFpModuls object which will be shared point-wide
|
||||
// (in the context of a point of course)
|
||||
set_shrd_mod(p_mod);
|
||||
@@ -44,21 +44,21 @@ CurveGFp::CurveGFp(const CurveGFp& other
|
||||
: mA(other.get_a()),
|
||||
mB(other.get_b())
|
||||
{
|
||||
- mp_mod = std::tr1::shared_ptr<GFpModulus>(new GFpModulus(*other.mp_mod));
|
||||
+ mp_mod = shared_ptr<GFpModulus>(new GFpModulus(*other.mp_mod));
|
||||
assert(mp_mod->p_equal_to(mA.get_p()));
|
||||
assert(mp_mod->p_equal_to(mB.get_p()));
|
||||
set_shrd_mod(mp_mod);
|
||||
if(other.mp_mres_a.get())
|
||||
{
|
||||
- mp_mres_a = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_a));
|
||||
+ mp_mres_a = shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_a));
|
||||
}
|
||||
if(other.mp_mres_b.get())
|
||||
{
|
||||
- mp_mres_b = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_b));
|
||||
+ mp_mres_b = shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_b));
|
||||
}
|
||||
if(other.mp_mres_one.get())
|
||||
{
|
||||
- mp_mres_one = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_one));
|
||||
+ mp_mres_one = shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_one));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -72,21 +72,21 @@ const CurveGFp& CurveGFp::operator=(cons
|
||||
mA.swap(a_tmp);
|
||||
mB.swap(b_tmp);
|
||||
|
||||
- std::tr1::shared_ptr<GFpModulus> p_mod = std::tr1::shared_ptr<GFpModulus>(new GFpModulus(*other.mp_mod));
|
||||
+ shared_ptr<GFpModulus> p_mod = shared_ptr<GFpModulus>(new GFpModulus(*other.mp_mod));
|
||||
set_shrd_mod(p_mod);
|
||||
|
||||
// exception safety note: no problem if we have a throw from here on...
|
||||
if(other.mp_mres_a.get())
|
||||
{
|
||||
- mp_mres_a = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_a));
|
||||
+ mp_mres_a = shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_a));
|
||||
}
|
||||
if(other.mp_mres_b.get())
|
||||
{
|
||||
- mp_mres_b = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_b));
|
||||
+ mp_mres_b = shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_b));
|
||||
}
|
||||
if(other.mp_mres_one.get())
|
||||
{
|
||||
- mp_mres_one = std::tr1::shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_one));
|
||||
+ mp_mres_one = shared_ptr<GFpElement>(new GFpElement(*other.mp_mres_one));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ GFpElement const CurveGFp::get_mres_a()
|
||||
{
|
||||
if(mp_mres_a.get() == 0)
|
||||
{
|
||||
- mp_mres_a = std::tr1::shared_ptr<GFpElement>(new GFpElement(mA));
|
||||
+ mp_mres_a = shared_ptr<GFpElement>(new GFpElement(mA));
|
||||
mp_mres_a->turn_on_sp_red_mul();
|
||||
mp_mres_a->get_mres();
|
||||
}
|
||||
@@ -134,18 +134,18 @@ GFpElement const CurveGFp::get_mres_b()
|
||||
{
|
||||
if(mp_mres_b.get() == 0)
|
||||
{
|
||||
- mp_mres_b = std::tr1::shared_ptr<GFpElement>(new GFpElement(mB));
|
||||
+ mp_mres_b = shared_ptr<GFpElement>(new GFpElement(mB));
|
||||
mp_mres_b->turn_on_sp_red_mul();
|
||||
mp_mres_b->get_mres();
|
||||
}
|
||||
return GFpElement(*mp_mres_b);
|
||||
}
|
||||
|
||||
-std::tr1::shared_ptr<GFpElement const> const CurveGFp::get_mres_one() const
|
||||
+shared_ptr<GFpElement const> const CurveGFp::get_mres_one() const
|
||||
{
|
||||
if(mp_mres_one.get() == 0)
|
||||
{
|
||||
- mp_mres_one = std::tr1::shared_ptr<GFpElement>(new GFpElement(mp_mod->get_p(), 1));
|
||||
+ mp_mres_one = shared_ptr<GFpElement>(new GFpElement(mp_mod->get_p(), 1));
|
||||
mp_mres_one->turn_on_sp_red_mul();
|
||||
mp_mres_one->get_mres();
|
||||
}
|
56
security/botan/patches/patch-src_math_gfpmath_curve__gfp.h
Normal file
56
security/botan/patches/patch-src_math_gfpmath_curve__gfp.h
Normal file
|
@ -0,0 +1,56 @@
|
|||
$NetBSD: patch-src_math_gfpmath_curve__gfp.h,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/math/gfpmath/curve_gfp.h.orig 2013-04-30 22:53:40.000000000 +0000
|
||||
+++ src/math/gfpmath/curve_gfp.h
|
||||
@@ -57,7 +57,7 @@ class BOTAN_DLL CurveGFp
|
||||
* @param mod a shared pointer to a GFpModulus object suitable for
|
||||
* *this.
|
||||
*/
|
||||
- void set_shrd_mod(const std::tr1::shared_ptr<GFpModulus> mod);
|
||||
+ void set_shrd_mod(const shared_ptr<GFpModulus> mod);
|
||||
|
||||
// getters
|
||||
|
||||
@@ -99,14 +99,14 @@ class BOTAN_DLL CurveGFp
|
||||
* function.
|
||||
* @result the GFpElement 1, transformed to its m-residue
|
||||
*/
|
||||
- std::tr1::shared_ptr<GFpElement const> const get_mres_one() const;
|
||||
+ shared_ptr<GFpElement const> const get_mres_one() const;
|
||||
|
||||
/**
|
||||
* Get prime modulus of the field of the curve
|
||||
* @result prime modulus of the field of the curve
|
||||
*/
|
||||
BigInt const get_p() const;
|
||||
- /*inline std::tr1::shared_ptr<BigInt> const get_ptr_p() const
|
||||
+ /*inline shared_ptr<BigInt> const get_ptr_p() const
|
||||
{
|
||||
return mp_p;
|
||||
}*/
|
||||
@@ -119,7 +119,7 @@ class BOTAN_DLL CurveGFp
|
||||
* Do NOT spread pointers to a GFpModulus over different threads!
|
||||
* @result a shared pointer to a GFpModulus object
|
||||
*/
|
||||
- inline std::tr1::shared_ptr<GFpModulus> const get_ptr_mod() const
|
||||
+ inline shared_ptr<GFpModulus> const get_ptr_mod() const
|
||||
{
|
||||
return mp_mod;
|
||||
}
|
||||
@@ -131,12 +131,12 @@ class BOTAN_DLL CurveGFp
|
||||
void swap(CurveGFp& other);
|
||||
|
||||
private:
|
||||
- std::tr1::shared_ptr<GFpModulus> mp_mod;
|
||||
+ shared_ptr<GFpModulus> mp_mod;
|
||||
GFpElement mA;
|
||||
GFpElement mB;
|
||||
- mutable std::tr1::shared_ptr<GFpElement> mp_mres_a;
|
||||
- mutable std::tr1::shared_ptr<GFpElement> mp_mres_b;
|
||||
- mutable std::tr1::shared_ptr<GFpElement> mp_mres_one;
|
||||
+ mutable shared_ptr<GFpElement> mp_mres_a;
|
||||
+ mutable shared_ptr<GFpElement> mp_mres_b;
|
||||
+ mutable shared_ptr<GFpElement> mp_mres_one;
|
||||
};
|
||||
|
||||
// relational operators
|
|
@ -0,0 +1,29 @@
|
|||
$NetBSD: patch-src_math_gfpmath_gfp__element.cpp,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/math/gfpmath/gfp_element.cpp.orig 2013-04-30 23:08:30.000000000 +0000
|
||||
+++ src/math/gfpmath/gfp_element.cpp
|
||||
@@ -174,13 +174,13 @@ GFpElement::GFpElement(const BigInt& p,
|
||||
m_is_trf(false)
|
||||
{
|
||||
assert(mp_mod.get() == 0);
|
||||
- mp_mod = std::tr1::shared_ptr<GFpModulus>(new GFpModulus(p));
|
||||
+ mp_mod = shared_ptr<GFpModulus>(new GFpModulus(p));
|
||||
assert(mp_mod->m_p_dash == 0);
|
||||
if(m_use_montgm)
|
||||
ensure_montgm_precomp();
|
||||
}
|
||||
|
||||
-GFpElement::GFpElement(std::tr1::shared_ptr<GFpModulus> const mod, const BigInt& value, bool use_montgm)
|
||||
+GFpElement::GFpElement(shared_ptr<GFpModulus> const mod, const BigInt& value, bool use_montgm)
|
||||
: mp_mod(),
|
||||
m_value(value % mod->m_p),
|
||||
m_use_montgm(use_montgm),
|
||||
@@ -247,7 +247,7 @@ void GFpElement::ensure_montgm_precomp()
|
||||
|
||||
}
|
||||
|
||||
-void GFpElement::set_shrd_mod(std::tr1::shared_ptr<GFpModulus> const p_mod)
|
||||
+void GFpElement::set_shrd_mod(shared_ptr<GFpModulus> const p_mod)
|
||||
{
|
||||
mp_mod = p_mod;
|
||||
}
|
69
security/botan/patches/patch-src_math_gfpmath_gfp__element.h
Normal file
69
security/botan/patches/patch-src_math_gfpmath_gfp__element.h
Normal file
|
@ -0,0 +1,69 @@
|
|||
$NetBSD: patch-src_math_gfpmath_gfp__element.h,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/math/gfpmath/gfp_element.h.orig 2013-04-30 22:49:33.000000000 +0000
|
||||
+++ src/math/gfpmath/gfp_element.h
|
||||
@@ -14,9 +14,12 @@
|
||||
|
||||
#include <botan/bigint.h>
|
||||
#include <botan/gfp_modulus.h>
|
||||
+#include <ciso646>
|
||||
#include <iosfwd>
|
||||
|
||||
-#if defined(BOTAN_USE_STD_TR1)
|
||||
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
|
||||
+ #include <memory>
|
||||
+#elif defined(BOTAN_USE_STD_TR1)
|
||||
#include <tr1/memory>
|
||||
#elif defined(BOTAN_USE_BOOST_TR1)
|
||||
#include <boost/tr1/memory.hpp>
|
||||
@@ -25,6 +28,14 @@
|
||||
#endif
|
||||
|
||||
namespace Botan {
|
||||
+#ifndef BOTAN_SHARED_PTR
|
||||
+#define BOTAN_SHARED_PTR
|
||||
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
|
||||
+ using std::shared_ptr;
|
||||
+#else
|
||||
+ using std::tr1::shared_ptr;
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
struct Illegal_Transformation : public Exception
|
||||
{
|
||||
@@ -40,7 +51,7 @@ struct Illegal_Transformation : public E
|
||||
class BOTAN_DLL GFpElement
|
||||
{
|
||||
private:
|
||||
- std::tr1::shared_ptr<GFpModulus> mp_mod;
|
||||
+ shared_ptr<GFpModulus> mp_mod;
|
||||
mutable BigInt m_value; // ordinary residue or m-residue respectively
|
||||
mutable BigInt workspace;
|
||||
|
||||
@@ -79,7 +90,7 @@ class BOTAN_DLL GFpElement
|
||||
* @param value the element value
|
||||
* @param use_montgm whether this object will use Montgomery multiplication
|
||||
*/
|
||||
- explicit GFpElement(std::tr1::shared_ptr<GFpModulus> const mod,
|
||||
+ explicit GFpElement(shared_ptr<GFpModulus> const mod,
|
||||
const BigInt& value, bool use_mongm = false);
|
||||
|
||||
/**
|
||||
@@ -190,7 +201,7 @@ class BOTAN_DLL GFpElement
|
||||
* the shared GFpModulus objects!
|
||||
* @result the shared pointer to the GFpModulus of *this
|
||||
*/
|
||||
- inline std::tr1::shared_ptr<GFpModulus> const get_ptr_mod() const
|
||||
+ inline shared_ptr<GFpModulus> const get_ptr_mod() const
|
||||
{
|
||||
return mp_mod;
|
||||
}
|
||||
@@ -203,7 +214,7 @@ class BOTAN_DLL GFpElement
|
||||
* the shared GFpModulus objects!
|
||||
* @param mod a shared pointer to a GFpModulus that will be held in *this
|
||||
*/
|
||||
- void set_shrd_mod(std::tr1::shared_ptr<GFpModulus> const mod);
|
||||
+ void set_shrd_mod(shared_ptr<GFpModulus> const mod);
|
||||
|
||||
/**
|
||||
* Tells whether this GFpElement is currently transformed to it´ m-residue,
|
53
security/botan/patches/patch-src_math_gfpmath_point__gfp.cpp
Normal file
53
security/botan/patches/patch-src_math_gfpmath_point__gfp.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
$NetBSD: patch-src_math_gfpmath_point__gfp.cpp,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/math/gfpmath/point_gfp.cpp.orig 2013-04-30 23:08:32.000000000 +0000
|
||||
+++ src/math/gfpmath/point_gfp.cpp
|
||||
@@ -109,7 +109,7 @@ const PointGFp& PointGFp::assign_within_
|
||||
return *this;
|
||||
}
|
||||
|
||||
-void PointGFp::set_shrd_mod(std::tr1::shared_ptr<GFpModulus> p_mod)
|
||||
+void PointGFp::set_shrd_mod(shared_ptr<GFpModulus> p_mod)
|
||||
{
|
||||
mX.set_shrd_mod(p_mod);
|
||||
mY.set_shrd_mod(p_mod);
|
||||
@@ -133,7 +133,7 @@ void PointGFp::ensure_worksp() const
|
||||
}
|
||||
}
|
||||
|
||||
- mp_worksp_gfp_el = std::tr1::shared_ptr<std::vector<GFpElement> >(new std::vector<GFpElement>);
|
||||
+ mp_worksp_gfp_el = shared_ptr<std::vector<GFpElement> >(new std::vector<GFpElement>);
|
||||
mp_worksp_gfp_el->reserve(9);
|
||||
for (u32bit i=0; i<GFPEL_WKSP_SIZE; i++)
|
||||
{
|
||||
@@ -337,8 +337,8 @@ PointGFp& PointGFp::mult_this_secure(con
|
||||
// use montgomery mult. in this operation
|
||||
this->turn_on_sp_red_mul();
|
||||
|
||||
- std::tr1::shared_ptr<PointGFp> H(new PointGFp(this->mC));
|
||||
- std::tr1::shared_ptr<PointGFp> tmp; // used for AADA
|
||||
+ shared_ptr<PointGFp> H(new PointGFp(this->mC));
|
||||
+ shared_ptr<PointGFp> tmp; // used for AADA
|
||||
|
||||
PointGFp P(*this);
|
||||
BigInt m(scalar);
|
||||
@@ -477,15 +477,15 @@ PointGFp& PointGFp::operator*=(const Big
|
||||
return *this;
|
||||
}
|
||||
|
||||
-inline std::tr1::shared_ptr<PointGFp> PointGFp::mult_loop(int l,
|
||||
+inline shared_ptr<PointGFp> PointGFp::mult_loop(int l,
|
||||
const BigInt& m,
|
||||
- std::tr1::shared_ptr<PointGFp> H,
|
||||
- std::tr1::shared_ptr<PointGFp> tmp,
|
||||
+ shared_ptr<PointGFp> H,
|
||||
+ shared_ptr<PointGFp> tmp,
|
||||
const PointGFp& P)
|
||||
{
|
||||
//assert(l >= (int)m.bits()- 1);
|
||||
tmp = H;
|
||||
- std::tr1::shared_ptr<PointGFp> to_add(new PointGFp(P)); // we just need some point
|
||||
+ shared_ptr<PointGFp> to_add(new PointGFp(P)); // we just need some point
|
||||
// so that we can use op=
|
||||
// inside the loop
|
||||
for (int i=l; i >=0; i--)
|
35
security/botan/patches/patch-src_math_gfpmath_point__gfp.h
Normal file
35
security/botan/patches/patch-src_math_gfpmath_point__gfp.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
$NetBSD: patch-src_math_gfpmath_point__gfp.h,v 1.1 2013/05/06 14:58:20 joerg Exp $
|
||||
|
||||
--- src/math/gfpmath/point_gfp.h.orig 2013-04-30 22:54:19.000000000 +0000
|
||||
+++ src/math/gfpmath/point_gfp.h
|
||||
@@ -234,7 +234,7 @@ class BOTAN_DLL PointGFp
|
||||
* @param mod a shared pointer to a GFpModulus that will
|
||||
* be held in the members *this
|
||||
*/
|
||||
- void set_shrd_mod(std::tr1::shared_ptr<GFpModulus> p_mod);
|
||||
+ void set_shrd_mod(shared_ptr<GFpModulus> p_mod);
|
||||
|
||||
static GFpElement decompress(bool yMod2, GFpElement const& x, const CurveGFp& curve);
|
||||
|
||||
@@ -242,9 +242,9 @@ class BOTAN_DLL PointGFp
|
||||
static const u32bit GFPEL_WKSP_SIZE = 9;
|
||||
void ensure_worksp() const;
|
||||
|
||||
- inline std::tr1::shared_ptr<PointGFp> mult_loop(int l, const BigInt& m,
|
||||
- std::tr1::shared_ptr<PointGFp> H,
|
||||
- std::tr1::shared_ptr<PointGFp> tmp,
|
||||
+ inline shared_ptr<PointGFp> mult_loop(int l, const BigInt& m,
|
||||
+ shared_ptr<PointGFp> H,
|
||||
+ shared_ptr<PointGFp> tmp,
|
||||
const PointGFp& P);
|
||||
|
||||
CurveGFp mC;
|
||||
@@ -257,7 +257,7 @@ class BOTAN_DLL PointGFp
|
||||
mutable bool mZpow2_set;
|
||||
mutable bool mZpow3_set;
|
||||
mutable bool mAZpow4_set;
|
||||
- mutable std::tr1::shared_ptr<std::vector<GFpElement> > mp_worksp_gfp_el;
|
||||
+ mutable shared_ptr<std::vector<GFpElement> > mp_worksp_gfp_el;
|
||||
|
||||
};
|
||||
|
Loading…
Reference in a new issue