aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pk_pad/emsa_pssr/pssr.cpp
diff options
context:
space:
mode:
authorDaniel Seither <[email protected]>2015-06-20 18:39:40 +0200
committerDaniel Seither <[email protected]>2015-06-20 19:05:07 +0200
commitbd5427214f0acba796f43bd6289f860fbed73519 (patch)
tree38f783fa532670fe7de910108f06e480f4bc3c8e /src/lib/pk_pad/emsa_pssr/pssr.cpp
parent9dc9dd03af7f0f175c05ab9886f5e71d3d3a760d (diff)
lib/pk_pad: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/pk_pad/emsa_pssr/pssr.cpp')
-rw-r--r--src/lib/pk_pad/emsa_pssr/pssr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/pk_pad/emsa_pssr/pssr.cpp b/src/lib/pk_pad/emsa_pssr/pssr.cpp
index 691d15964..a4744f8f4 100644
--- a/src/lib/pk_pad/emsa_pssr/pssr.cpp
+++ b/src/lib/pk_pad/emsa_pssr/pssr.cpp
@@ -72,7 +72,7 @@ secure_vector<byte> PSSR::encoding_of(const secure_vector<byte>& msg,
EM[output_length - HASH_SIZE - SALT_SIZE - 2] = 0x01;
buffer_insert(EM, output_length - 1 - HASH_SIZE - SALT_SIZE, salt);
- mgf1_mask(*hash, &H[0], HASH_SIZE, &EM[0], output_length - HASH_SIZE - 1);
+ mgf1_mask(*hash, H.data(), HASH_SIZE, EM.data(), output_length - HASH_SIZE - 1);
EM[0] &= 0xFF >> (8 * ((output_bits + 7) / 8) - output_bits);
buffer_insert(EM, output_length - 1 - HASH_SIZE, H);
EM[output_length-1] = 0xBC;
@@ -113,13 +113,13 @@ bool PSSR::verify(const secure_vector<byte>& const_coded,
if(TOP_BITS > 8 - high_bit(coded[0]))
return false;
- byte* DB = &coded[0];
+ byte* DB = coded.data();
const size_t DB_size = coded.size() - HASH_SIZE - 1;
const byte* H = &coded[DB_size];
const size_t H_size = HASH_SIZE;
- mgf1_mask(*hash, &H[0], H_size, &DB[0], DB_size);
+ mgf1_mask(*hash, H, H_size, DB, DB_size);
DB[0] &= 0xFF >> TOP_BITS;
size_t salt_offset = 0;
@@ -139,7 +139,7 @@ bool PSSR::verify(const secure_vector<byte>& const_coded,
hash->update(&DB[salt_offset], DB_size - salt_offset);
secure_vector<byte> H2 = hash->final();
- return same_mem(&H[0], &H2[0], HASH_SIZE);
+ return same_mem(H, H2.data(), HASH_SIZE);
}
PSSR::PSSR(HashFunction* h) :