diff options
author | Simon Warta <[email protected]> | 2015-06-24 20:18:56 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-25 01:50:52 +0200 |
commit | 1033054c1495d4a10afc33f2747d24d9c32b6907 (patch) | |
tree | 776c291a37b5d86d82739591d62e3602ee294f38 /src/lib/misc/tss/tss.cpp | |
parent | f3e2ba1c8273e439f4d18dabc253d6aad47ac622 (diff) |
lib/misc: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/misc/tss/tss.cpp')
-rw-r--r-- | src/lib/misc/tss/tss.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/misc/tss/tss.cpp b/src/lib/misc/tss/tss.cpp index c021bff7b..6904f9f0a 100644 --- a/src/lib/misc/tss/tss.cpp +++ b/src/lib/misc/tss/tss.cpp @@ -118,7 +118,7 @@ byte RTSS_Share::share_id() const std::string RTSS_Share::to_string() const { - return hex_encode(&contents[0], contents.size()); + return hex_encode(contents.data(), contents.size()); } std::vector<RTSS_Share> @@ -155,7 +155,7 @@ RTSS_Share::split(byte M, byte N, for(size_t i = 0; i != secret.size(); ++i) { std::vector<byte> coefficients(M-1); - rng.randomize(&coefficients[0], coefficients.size()); + rng.randomize(coefficients.data(), coefficients.size()); for(byte j = 0; j != N; ++j) { @@ -248,14 +248,14 @@ RTSS_Share::reconstruct(const std::vector<RTSS_Share>& shares) if(secret.size() != secret_len + hash->output_length()) throw Decoding_Error("Bad length in RTSS output"); - hash->update(&secret[0], secret_len); + hash->update(secret.data(), secret_len); secure_vector<byte> hash_check = hash->final(); - if(!same_mem(&hash_check[0], + if(!same_mem(hash_check.data(), &secret[secret_len], hash->output_length())) throw Decoding_Error("RTSS hash check failed"); - return secure_vector<byte>(&secret[0], &secret[secret_len]); + return secure_vector<byte>(secret.cbegin(), secret.cbegin() + secret_len); } } |