summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorscottmg <scottmg@chromium.org>2015-02-20 12:59:34 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-20 21:00:20 +0000
commitcb6a123e432e617052721ef43823fd60b002284e (patch)
treea83823780fd82b72bb25abe13db869439fbd6449 /crypto
parentab87bce6b23bf1a0e88245959aac54f92a63f1e6 (diff)
downloadchromium_src-cb6a123e432e617052721ef43823fd60b002284e.zip
chromium_src-cb6a123e432e617052721ef43823fd60b002284e.tar.gz
chromium_src-cb6a123e432e617052721ef43823fd60b002284e.tar.bz2
win vs2015: avoid some variable shadowing warnings in crypto/p224
e.g. d:\src\cr2\src\crypto\p224.cc(478): error C2220: warning treated as error - no 'object' file generated d:\src\cr2\src\crypto\p224.cc(478): warning C4456: declaration of 'j' hides previous local declaration d:\src\cr2\src\crypto\p224.cc(447): note: see declaration of 'j' d:\src\cr2\src\crypto\p224.cc(498): warning C4456: declaration of 'i' hides previous local declaration d:\src\cr2\src\crypto\p224.cc(447): note: see declaration of 'i' d:\src\cr2\src\crypto\p224.cc(516): warning C4456: declaration of 'i' hides previous local declaration d:\src\cr2\src\crypto\p224.cc(447): note: see declaration of 'i' d:\src\cr2\src\crypto\p224.cc(526): warning C4456: declaration of 'i' hides previous local declaration d:\src\cr2\src\crypto\p224.cc(447): note: see declaration of 'i' d:\src\cr2\src\crypto\p224.cc(694): warning C4458: declaration of 'x' hides class member d:\src\cr2\src\crypto\p224.h(35): note: see declaration of 'crypto::p224::Point::x' d:\src\cr2\src\crypto\p224.cc(694): warning C4458: declaration of 'y' hides class member d:\src\cr2\src\crypto\p224.h(35): note: see declaration of 'crypto::p224::Point::y' R=rsleevi@chromium.org BUG=440500 Review URL: https://codereview.chromium.org/945633003 Cr-Commit-Position: refs/heads/master@{#317398}
Diffstat (limited to 'crypto')
-rw-r--r--crypto/p224.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/crypto/p224.cc b/crypto/p224.cc
index e8b56b8..11946a9 100644
--- a/crypto/p224.cc
+++ b/crypto/p224.cc
@@ -475,8 +475,8 @@ void AddJacobian(Point *out,
uint32 x_equal = IsZero(h);
// I = (2*H)²
- for (int j = 0; j < 8; j++) {
- i[j] = h[j] << 1;
+ for (int k = 0; k < 8; k++) {
+ i[k] = h[k] << 1;
}
Reduce(&i);
Square(&i, i);
@@ -495,8 +495,8 @@ void AddJacobian(Point *out,
return;
}
- for (int i = 0; i < 8; i++) {
- r[i] <<= 1;
+ for (int k = 0; k < 8; k++) {
+ r[k] <<= 1;
}
Reduce(&r);
@@ -513,8 +513,8 @@ void AddJacobian(Point *out,
Mul(&out->z, out->z, h);
// X3 = r²-J-2*V
- for (int i = 0; i < 8; i++) {
- z1z1[i] = v[i] << 1;
+ for (int k = 0; k < 8; k++) {
+ z1z1[k] = v[k] << 1;
}
Add(&z1z1, j, z1z1);
Reduce(&z1z1);
@@ -523,8 +523,8 @@ void AddJacobian(Point *out,
Reduce(&out->x);
// Y3 = r*(V-X3)-2*S1*J
- for (int i = 0; i < 8; i++) {
- s1[i] <<= 1;
+ for (int k = 0; k < 8; k++) {
+ s1[k] <<= 1;
}
Mul(&s1, s1, j);
Subtract(&z1z1, v, out->x);
@@ -691,7 +691,7 @@ bool Point::SetFromString(const base::StringPiece& in) {
}
std::string Point::ToString() const {
- FieldElement zinv, zinv_sq, x, y;
+ FieldElement zinv, zinv_sq, xx, yy;
// If this is the point at infinity we return a string of all zeros.
if (IsZero(this->z)) {
@@ -701,16 +701,16 @@ std::string Point::ToString() const {
Invert(&zinv, this->z);
Square(&zinv_sq, zinv);
- Mul(&x, this->x, zinv_sq);
+ Mul(&xx, x, zinv_sq);
Mul(&zinv_sq, zinv_sq, zinv);
- Mul(&y, this->y, zinv_sq);
+ Mul(&yy, y, zinv_sq);
- Contract(&x);
- Contract(&y);
+ Contract(&xx);
+ Contract(&yy);
uint32 outwords[14];
- Put224Bits(outwords, x);
- Put224Bits(outwords + 7, y);
+ Put224Bits(outwords, xx);
+ Put224Bits(outwords + 7, yy);
return std::string(reinterpret_cast<const char*>(outwords), sizeof(outwords));
}