diff options
Diffstat (limited to 'src/lib/pk_pad/emsa_pssr/pssr.cpp')
-rw-r--r-- | src/lib/pk_pad/emsa_pssr/pssr.cpp | 8 |
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) : |