aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/mce/polyn_gf2m.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-01-23 17:47:31 +0000
committerlloyd <[email protected]>2015-01-23 17:47:31 +0000
commit848314e16daed06e6e519dbf8c40edf9c85a51bf (patch)
treea7d246972486ae5f49090689090af7d351110ec6 /src/lib/pubkey/mce/polyn_gf2m.cpp
parentb6cc9a4084caf6d9d4b955fadc321f6521f2b36e (diff)
Centralize where string.h/cstring is included to mem_ops.h
See github 42 for background
Diffstat (limited to 'src/lib/pubkey/mce/polyn_gf2m.cpp')
-rw-r--r--src/lib/pubkey/mce/polyn_gf2m.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/pubkey/mce/polyn_gf2m.cpp b/src/lib/pubkey/mce/polyn_gf2m.cpp
index e340e29e8..489332069 100644
--- a/src/lib/pubkey/mce/polyn_gf2m.cpp
+++ b/src/lib/pubkey/mce/polyn_gf2m.cpp
@@ -10,9 +10,6 @@
*/
#include <botan/polyn_gf2m.h>
-#include <cstring>
-#include <iostream>
-
#include <botan/gf2m_rootfind_dcmp.h>
#include <botan/code_based_util.h>
#include <botan/gf2m_small_m.h>
@@ -219,7 +216,7 @@ void polyn_gf2m::encode(u32bit min_numo_coeffs, byte* mem, u32bit mem_len) const
void polyn_gf2m::set_to_zero()
{
- memset(&this->coeff[0], 0, this->coeff.size() * sizeof (gf2m));
+ clear_mem(&this->coeff[0], this->coeff.size());
this->m_deg = -1;
}
@@ -304,8 +301,8 @@ std::vector<polyn_gf2m> polyn_gf2m::sqmod_init(const polyn_gf2m & g)
for (; i < d; ++i)
{
- memset(&sq[i].coeff[0], 0, 2 * sizeof (gf2m));
- memcpy(&sq[i].coeff[0] + 2, &sq[i - 1].coeff[0], d * sizeof (gf2m));
+ clear_mem(&sq[i].coeff[0], 2);
+ copy_mem(&sq[i].coeff[0] + 2, &sq[i - 1].coeff[0], d);
sq[i].set_degree( sq[i - 1].get_degree() + 2);
polyn_gf2m::remainder(sq[i], g);
}