diff options
Diffstat (limited to 'src/pubkey/elgamal/elgamal.cpp')
-rw-r--r-- | src/pubkey/elgamal/elgamal.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pubkey/elgamal/elgamal.cpp b/src/pubkey/elgamal/elgamal.cpp index a264d209b..58336b1b1 100644 --- a/src/pubkey/elgamal/elgamal.cpp +++ b/src/pubkey/elgamal/elgamal.cpp @@ -93,8 +93,8 @@ ElGamal_Encryption_Operation::encrypt(const byte msg[], u32bit msg_len, BigInt b = mod_p.multiply(m, powermod_y_p(k)); SecureVector<byte> output(2*p.bytes()); - a.binary_encode(output + (p.bytes() - a.bytes())); - b.binary_encode(output + output.size() / 2 + (p.bytes() - b.bytes())); + a.binary_encode(&output[p.bytes() - a.bytes()]); + b.binary_encode(&output[output.size() / 2 + (p.bytes() - b.bytes())]); return output; } |