Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: crypto/curve25519_nss.cc

Issue 1539353003: Switch to standard integer types in crypto/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « crypto/cssm_init.cc ('k') | crypto/curve25519_openssl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stdint.h>
8
7 #include "crypto/secure_util.h" 9 #include "crypto/secure_util.h"
8 10
9 // Curve25519 is specified in terms of byte strings, not numbers, so all 11 // Curve25519 is specified in terms of byte strings, not numbers, so all
10 // implementations take and return the same sequence of bits. So the byte 12 // implementations take and return the same sequence of bits. So the byte
11 // order is implicitly specified as in, say, SHA1. 13 // order is implicitly specified as in, say, SHA1.
12 // 14 //
13 // Prototype for |curve25519_donna| function in 15 // Prototype for |curve25519_donna| function in
14 // third_party/curve25519-donna/curve25519-donna.c 16 // third_party/curve25519-donna/curve25519-donna.c
15 extern "C" int curve25519_donna(uint8_t*, const uint8_t*, const uint8_t*); 17 extern "C" int curve25519_donna(uint8_t*, const uint8_t*, const uint8_t*);
16 18
(...skipping 16 matching lines...) Expand all
33 // See "Computing public keys" section of http://cr.yp.to/ecdh.html. 35 // See "Computing public keys" section of http://cr.yp.to/ecdh.html.
34 static const uint8_t kBasePoint[32] = {9}; 36 static const uint8_t kBasePoint[32] = {9};
35 37
36 void ScalarBaseMult(const uint8_t* private_key, uint8_t* public_key) { 38 void ScalarBaseMult(const uint8_t* private_key, uint8_t* public_key) {
37 curve25519_donna(public_key, private_key, kBasePoint); 39 curve25519_donna(public_key, private_key, kBasePoint);
38 } 40 }
39 41
40 } // namespace curve25519 42 } // namespace curve25519
41 43
42 } // namespace crypto 44 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/cssm_init.cc ('k') | crypto/curve25519_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698