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

Unified Diff: crypto/p224_unittest.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/p224_spake_unittest.cc ('k') | crypto/random.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/p224_unittest.cc
diff --git a/crypto/p224_unittest.cc b/crypto/p224_unittest.cc
index aaf5f59f47e770abd149ae9c8c712a021f6767a0..faa08ebd360df974aba8a060db52c6e14f58cbde 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.
« no previous file with comments | « crypto/p224_spake_unittest.cc ('k') | crypto/random.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698