diff options
author | lloyd <[email protected]> | 2010-09-14 02:05:05 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-14 02:05:05 +0000 |
commit | 77a33b0c16880884cc0326e92c0c30d0e8444a91 (patch) | |
tree | df2d917b312abb79c8654558399521366dbb2d14 /src/math | |
parent | 59a9b0ef260b010606edc3384035b6aa12dd6415 (diff) |
More changes to avoid vector to pointer implicit conversions
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/bigint/big_code.cpp | 10 | ||||
-rw-r--r-- | src/math/bigint/big_rand.cpp | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/math/bigint/big_code.cpp b/src/math/bigint/big_code.cpp index a8272390d..1e35edcc9 100644 --- a/src/math/bigint/big_code.cpp +++ b/src/math/bigint/big_code.cpp @@ -22,7 +22,7 @@ void BigInt::encode(byte output[], const BigInt& n, Base base) else if(base == Hexadecimal) { SecureVector<byte> binary(n.encoded_size(Binary)); - n.binary_encode(binary); + n.binary_encode(&binary[0]); hex_encode(reinterpret_cast<char*>(output), &binary[0], binary.size()); @@ -62,7 +62,7 @@ void BigInt::encode(byte output[], const BigInt& n, Base base) SecureVector<byte> BigInt::encode(const BigInt& n, Base base) { SecureVector<byte> output(n.encoded_size(base)); - encode(output, n, base); + encode(&output[0], n, base); if(base != Binary) for(u32bit j = 0; j != output.size(); ++j) if(output[j] == 0) @@ -82,7 +82,7 @@ SecureVector<byte> BigInt::encode_1363(const BigInt& n, u32bit bytes) const u32bit leading_0s = bytes - n_bytes; SecureVector<byte> output(bytes); - encode(output + leading_0s, n, Binary); + encode(&output[leading_0s], n, Binary); return output; } @@ -91,7 +91,7 @@ SecureVector<byte> BigInt::encode_1363(const BigInt& n, u32bit bytes) */ BigInt BigInt::decode(const MemoryRegion<byte>& buf, Base base) { - return BigInt::decode(buf, buf.size(), base); + return BigInt::decode(&buf[0], buf.size(), base); } /* @@ -121,7 +121,7 @@ BigInt BigInt::decode(const byte buf[], u32bit length, Base base) binary = hex_decode(reinterpret_cast<const char*>(buf), length, false); - r.binary_decode(binary, binary.size()); + r.binary_decode(&binary[0], binary.size()); } else if(base == Decimal || base == Octal) { diff --git a/src/math/bigint/big_rand.cpp b/src/math/bigint/big_rand.cpp index 84ad02587..29fdf1de6 100644 --- a/src/math/bigint/big_rand.cpp +++ b/src/math/bigint/big_rand.cpp @@ -40,7 +40,7 @@ void BigInt::randomize(RandomNumberGenerator& rng, if(bitsize % 8) array[0] &= 0xFF >> (8 - (bitsize % 8)); array[0] |= 0x80 >> ((bitsize % 8) ? (8 - bitsize % 8) : 0); - binary_decode(array, array.size()); + binary_decode(&array[0], array.size()); } } |