OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "crypto/curve25519.h" | 5 #include "crypto/curve25519.h" |
6 | 6 |
7 #include <openssl/curve25519.h> | |
8 #include <stdint.h> | 7 #include <stdint.h> |
9 | 8 |
| 9 #include "third_party/boringssl/src/include/openssl/curve25519.h" |
| 10 |
10 namespace crypto { | 11 namespace crypto { |
11 | 12 |
12 namespace curve25519 { | 13 namespace curve25519 { |
13 | 14 |
14 bool ScalarMult(const uint8_t* private_key, | 15 bool ScalarMult(const uint8_t* private_key, |
15 const uint8_t* peer_public_key, | 16 const uint8_t* peer_public_key, |
16 uint8_t* shared_key) { | 17 uint8_t* shared_key) { |
17 return !!X25519(shared_key, private_key, peer_public_key); | 18 return !!X25519(shared_key, private_key, peer_public_key); |
18 } | 19 } |
19 | 20 |
20 void ScalarBaseMult(const uint8_t* private_key, uint8_t* public_key) { | 21 void ScalarBaseMult(const uint8_t* private_key, uint8_t* public_key) { |
21 X25519_public_from_private(public_key, private_key); | 22 X25519_public_from_private(public_key, private_key); |
22 } | 23 } |
23 | 24 |
24 } // namespace curve25519 | 25 } // namespace curve25519 |
25 | 26 |
26 } // namespace crypto | 27 } // namespace crypto |
OLD | NEW |