aboutsummaryrefslogtreecommitdiff
path: root/include/axolotl/crypto.hh
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-02-27 16:11:30 +0000
committerMark Haines <mark.haines@matrix.org>2015-02-27 16:11:30 +0000
commitc7419e7cdffc8c8d54dd918b03ed2c497fe7ca42 (patch)
tree6fd1bf8666863e36ab4729ec0f1ca8438e88e745 /include/axolotl/crypto.hh
parentb3496b0aa16b8c4f9974ed54fca59ef631f83705 (diff)
Try to ensure the compiler cannot optimise away attempts to erase secrets from memory
Diffstat (limited to 'include/axolotl/crypto.hh')
-rw-r--r--include/axolotl/crypto.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/axolotl/crypto.hh b/include/axolotl/crypto.hh
index 09e5b8e..162099f 100644
--- a/include/axolotl/crypto.hh
+++ b/include/axolotl/crypto.hh
@@ -28,6 +28,7 @@ struct Curve25519KeyPair : public Curve25519PublicKey {
std::uint8_t private_key[32];
};
+
/** Generate a curve25519 key pair from 32 random bytes. */
void generate_key(
std::uint8_t const * random_32_bytes,
@@ -37,6 +38,7 @@ void generate_key(
const std::size_t CURVE25519_SHARED_SECRET_LENGTH = 32;
+
/** Create a shared secret using our private key and their public key.
* The output buffer must be at least 32 bytes long. */
void curve25519_shared_secret(