aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/mce/mceliece.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/mceliece.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/mceliece.cpp')
-rw-r--r--src/lib/pubkey/mce/mceliece.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/pubkey/mce/mceliece.cpp b/src/lib/pubkey/mce/mceliece.cpp
index d0c36a92e..15a6f5ea8 100644
--- a/src/lib/pubkey/mce/mceliece.cpp
+++ b/src/lib/pubkey/mce/mceliece.cpp
@@ -26,8 +26,8 @@ void concat_vectors(unsigned char* x, const unsigned char* a, const unsigned cha
{
if(dimension % 8 == 0)
{
- std::memcpy(x, a, bit_size_to_byte_size(dimension));
- std::memcpy(((unsigned char *) x) + bit_size_to_byte_size(dimension), b, bit_size_to_byte_size(codimension));
+ copy_mem(x, a, bit_size_to_byte_size(dimension));
+ copy_mem(((unsigned char *) x) + bit_size_to_byte_size(dimension), b, bit_size_to_byte_size(codimension));
}
else
{
@@ -35,7 +35,7 @@ void concat_vectors(unsigned char* x, const unsigned char* a, const unsigned cha
i = dimension - 8 * (dimension/ 8);
j = 8 - i;
l = dimension / 8;
- std::memcpy(x, a, 1 * (dimension / 8));
+ copy_mem(x, a, 1 * (dimension / 8));
x[l] = ((byte) (a[l] & ((1 << i) - 1)));
for(k = 0; k < codimension / 8; ++k)
@@ -149,7 +149,7 @@ secure_vector<byte> McEliece_Public_Operation::encrypt(const byte msg[], size_t
std::vector<byte> ciphertext_tmp = mceliece_encrypt( message_word, m_pub_key.get_public_matrix(), err_pos, m_code_length);
- std::memcpy(&ciphertext[0], &ciphertext_tmp[0], ciphertext.size());
+ copy_mem(&ciphertext[0], &ciphertext_tmp[0], ciphertext.size());
return ciphertext;
}