diff options
author | lloyd <[email protected]> | 2010-09-13 15:21:31 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-13 15:21:31 +0000 |
commit | 4a7e9edcc92b08a285ea24549fd8c813d10b63b9 (patch) | |
tree | 569e357cbc1bd2b195c1b10b281f6c0bbf01fd33 /src/pubkey | |
parent | 27d79c87365105d6128afe9eaf8a82383976ed44 (diff) |
First set of changes for avoiding use implicit vector->pointer conversions
Diffstat (limited to 'src/pubkey')
-rw-r--r-- | src/pubkey/dsa/dsa.cpp | 4 | ||||
-rw-r--r-- | src/pubkey/ecdsa/ecdsa.cpp | 4 | ||||
-rw-r--r-- | src/pubkey/pubkey.h | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/pubkey/dsa/dsa.cpp b/src/pubkey/dsa/dsa.cpp index 7eefa5923..a3917b3d7 100644 --- a/src/pubkey/dsa/dsa.cpp +++ b/src/pubkey/dsa/dsa.cpp @@ -94,8 +94,8 @@ DSA_Signature_Operation::sign(const byte msg[], u32bit msg_len, } SecureVector<byte> output(2*q.bytes()); - r.binary_encode(output + (output.size() / 2 - r.bytes())); - s.binary_encode(output + (output.size() - s.bytes())); + r.binary_encode(&output[output.size() / 2 - r.bytes()]); + s.binary_encode(&output[output.size() - s.bytes()]); return output; } diff --git a/src/pubkey/ecdsa/ecdsa.cpp b/src/pubkey/ecdsa/ecdsa.cpp index 8915a598e..88ef8a38a 100644 --- a/src/pubkey/ecdsa/ecdsa.cpp +++ b/src/pubkey/ecdsa/ecdsa.cpp @@ -55,8 +55,8 @@ ECDSA_Signature_Operation::sign(const byte msg[], u32bit msg_len, BigInt s = mod_order.multiply(inverse_mod(k, order), mul_add(x, r, m)); SecureVector<byte> output(2*order.bytes()); - r.binary_encode(output + (output.size() / 2 - r.bytes())); - s.binary_encode(output + (output.size() - s.bytes())); + r.binary_encode(&output[output.size() / 2 - r.bytes()]); + s.binary_encode(&output[output.size() - s.bytes()]); return output; } diff --git a/src/pubkey/pubkey.h b/src/pubkey/pubkey.h index ff4355675..2ea60fc86 100644 --- a/src/pubkey/pubkey.h +++ b/src/pubkey/pubkey.h @@ -230,7 +230,8 @@ class BOTAN_DLL PK_Verifier bool verify_message(const MemoryRegion<byte>& msg, const MemoryRegion<byte>& sig) { - return verify_message(msg, msg.size(), sig, sig.size()); + return verify_message(&msg[0], msg.size(), + &sig[0], sig.size()); } /** |