diff options
author | jsing <> | 2016-11-05 14:57:29 +0000 |
---|---|---|
committer | jsing <> | 2016-11-05 14:57:29 +0000 |
commit | adb72aa0e0ceb7ed3651bd3410f1509d77ad825e (patch) | |
tree | f489c520039d048388d278c2cd2c9d40a3d62afe /src/lib/libcrypto/curve25519/curve25519-generic.c | |
parent | 857e056d8e939aab5d14f1aadf80c28fe9a4f805 (diff) | |
download | openbsd-adb72aa0e0ceb7ed3651bd3410f1509d77ad825e.tar.gz openbsd-adb72aa0e0ceb7ed3651bd3410f1509d77ad825e.tar.bz2 openbsd-adb72aa0e0ceb7ed3651bd3410f1509d77ad825e.zip |
Add support for X25519.
This brings in code from BoringSSL, which is mostly taken from SUPERCOP.
ok beck@ bcook@
Diffstat (limited to 'src/lib/libcrypto/curve25519/curve25519-generic.c')
-rw-r--r-- | src/lib/libcrypto/curve25519/curve25519-generic.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/lib/libcrypto/curve25519/curve25519-generic.c b/src/lib/libcrypto/curve25519/curve25519-generic.c new file mode 100644 index 0000000000..e7373d2bcb --- /dev/null +++ b/src/lib/libcrypto/curve25519/curve25519-generic.c | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2015, Google Inc. | ||
3 | * | ||
4 | * Permission to use, copy, modify, and/or distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
11 | * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION | ||
13 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | ||
14 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | |||
17 | /* | ||
18 | * This code is mostly taken from the ref10 version of Ed25519 in SUPERCOP | ||
19 | * 20141124 (http://bench.cr.yp.to/supercop.html). That code is released as | ||
20 | * public domain but this file has the ISC license just to keep licencing | ||
21 | * simple. | ||
22 | * | ||
23 | * The field functions are shared by Ed25519 and X25519 where possible. | ||
24 | */ | ||
25 | |||
26 | #include "curve25519_internal.h" | ||
27 | |||
28 | void | ||
29 | x25519_scalar_mult(uint8_t out[32], const uint8_t scalar[32], | ||
30 | const uint8_t point[32]) | ||
31 | { | ||
32 | x25519_scalar_mult_generic(out, scalar, point); | ||
33 | } | ||