aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/mce/mceliece.h
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-06-23 20:07:15 +0200
committerSimon Warta <[email protected]>2015-06-23 20:07:15 +0200
commitfd1c77c5cf8d86c6ba6d2f5c8cf898502c463eba (patch)
tree6ac5df8e74d2ad203f03da28aba46e2a4bfdbea5 /src/lib/pubkey/mce/mceliece.h
parent2a83523815461a4aa461ce5cc3b1288727440705 (diff)
lib/pubkey: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/pubkey/mce/mceliece.h')
-rw-r--r--src/lib/pubkey/mce/mceliece.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/pubkey/mce/mceliece.h b/src/lib/pubkey/mce/mceliece.h
index 19de27d8e..b62afee3a 100644
--- a/src/lib/pubkey/mce/mceliece.h
+++ b/src/lib/pubkey/mce/mceliece.h
@@ -30,15 +30,15 @@ class mceliece_message_parts
public:
mceliece_message_parts(const secure_vector<gf2m>& err_pos, const byte* message, u32bit message_length, u32bit code_length) :
- m_error_vector(error_vector_from_error_positions(&err_pos[0], err_pos.size(), code_length)),
+ m_error_vector(error_vector_from_error_positions(err_pos.data(), err_pos.size(), code_length)),
m_code_length(code_length)
{
m_message_word.resize(message_length);
- copy_mem(&m_message_word[0], message, message_length);
+ copy_mem(m_message_word.data(), message, message_length);
}
mceliece_message_parts(const secure_vector<gf2m>& err_pos, const secure_vector<byte>& message, unsigned code_length) :
- m_error_vector(error_vector_from_error_positions(&err_pos[0], err_pos.size(), code_length)),
+ m_error_vector(error_vector_from_error_positions(err_pos.data(), err_pos.size(), code_length)),
m_message_word(message),
m_code_length(code_length)
{}
@@ -68,17 +68,17 @@ class mceliece_message_parts
throw Invalid_Argument("cannot split McEliece message parts");
}
size_t err_vec_start_pos = message_concat_errors_len - err_vec_len;
- m_message_word = secure_vector<byte>(err_vec_start_pos );
- copy_mem(&m_message_word[0], &message_concat_errors[0], err_vec_start_pos);
- m_error_vector = secure_vector<byte>(err_vec_len );
- copy_mem(&m_error_vector[0], &message_concat_errors[err_vec_start_pos], err_vec_len);
+ m_message_word = secure_vector<byte>(err_vec_start_pos);
+ copy_mem(m_message_word.data(), message_concat_errors, err_vec_start_pos);
+ m_error_vector = secure_vector<byte>(err_vec_len);
+ copy_mem(m_error_vector.data(), &message_concat_errors[err_vec_start_pos], err_vec_len);
}
secure_vector<byte> get_concat() const
{
secure_vector<byte> result(m_error_vector.size() + m_message_word.size());
- copy_mem(&result[0], &m_message_word[0], m_message_word.size());
- copy_mem(&result[m_message_word.size()], &m_error_vector[0], m_error_vector.size());
+ copy_mem(result.data(), m_message_word.data(), m_message_word.size());
+ copy_mem(&result[m_message_word.size()], m_error_vector.data(), m_error_vector.size());
return result;
}