diff options
author | avi <avi@chromium.org> | 2015-12-21 13:34:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-21 21:35:49 +0000 |
commit | dd373b8b7d7501cf7f3bbfe861f58dce67578a69 (patch) | |
tree | 037d2922a3dc5079e1eff59e9a3eb5fe3c605fa0 /crypto/p224_unittest.cc | |
parent | 64114156487081d877b793d3a501a8658743141d (diff) | |
download | chromium_src-dd373b8b7d7501cf7f3bbfe861f58dce67578a69.zip chromium_src-dd373b8b7d7501cf7f3bbfe861f58dce67578a69.tar.gz chromium_src-dd373b8b7d7501cf7f3bbfe861f58dce67578a69.tar.bz2 |
Switch to standard integer types in crypto/.
BUG=138542
TBR=rsleevi@chromium.org
NOPRESUBMIT=true
Review URL: https://codereview.chromium.org/1539353003
Cr-Commit-Position: refs/heads/master@{#366460}
Diffstat (limited to 'crypto/p224_unittest.cc')
-rw-r--r-- | crypto/p224_unittest.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/crypto/p224_unittest.cc b/crypto/p224_unittest.cc index aaf5f59..faa08eb 100644 --- a/crypto/p224_unittest.cc +++ b/crypto/p224_unittest.cc @@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <string.h> +#include <stddef.h> +#include <stdint.h> #include <stdio.h> +#include <string.h> #include "crypto/p224.h" +#include "base/macros.h" #include "testing/gtest/include/gtest/gtest.h" namespace crypto { @@ -14,22 +17,20 @@ namespace crypto { using p224::Point; // kBasePointExternal is the P224 base point in external representation. -static const uint8 kBasePointExternal[56] = { - 0xb7, 0x0e, 0x0c, 0xbd, 0x6b, 0xb4, 0xbf, 0x7f, - 0x32, 0x13, 0x90, 0xb9, 0x4a, 0x03, 0xc1, 0xd3, - 0x56, 0xc2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xd6, - 0x11, 0x5c, 0x1d, 0x21, 0xbd, 0x37, 0x63, 0x88, - 0xb5, 0xf7, 0x23, 0xfb, 0x4c, 0x22, 0xdf, 0xe6, - 0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, - 0x44, 0xd5, 0x81, 0x99, 0x85, 0x00, 0x7e, 0x34, +static const uint8_t kBasePointExternal[56] = { + 0xb7, 0x0e, 0x0c, 0xbd, 0x6b, 0xb4, 0xbf, 0x7f, 0x32, 0x13, 0x90, 0xb9, + 0x4a, 0x03, 0xc1, 0xd3, 0x56, 0xc2, 0x11, 0x22, 0x34, 0x32, 0x80, 0xd6, + 0x11, 0x5c, 0x1d, 0x21, 0xbd, 0x37, 0x63, 0x88, 0xb5, 0xf7, 0x23, 0xfb, + 0x4c, 0x22, 0xdf, 0xe6, 0xcd, 0x43, 0x75, 0xa0, 0x5a, 0x07, 0x47, 0x64, + 0x44, 0xd5, 0x81, 0x99, 0x85, 0x00, 0x7e, 0x34, }; // TestVector represents a test of scalar multiplication of the base point. // |scalar| is a big-endian scalar and |affine| is the external representation // of g*scalar. struct TestVector { - uint8 scalar[28]; - uint8 affine[28*2]; + uint8_t scalar[28]; + uint8_t affine[28 * 2]; }; static const int kNumNISTTestVectors = 52; @@ -814,7 +815,7 @@ TEST(P224, Infinity) { // Test that x^0 = ∞. Point a; - p224::ScalarBaseMult(reinterpret_cast<const uint8*>(zeros), &a); + p224::ScalarBaseMult(reinterpret_cast<const uint8_t*>(zeros), &a); EXPECT_TRUE(memcmp(zeros, a.ToString().data(), sizeof(zeros)) == 0); // We shouldn't allow ∞ to be imported. |