diff options
author | jkummerow@chromium.org <jkummerow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-07 15:48:38 +0000 |
---|---|---|
committer | jkummerow@chromium.org <jkummerow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-07 15:48:38 +0000 |
commit | e22bd0de2f37b831db7c6a57543029a5aac9dd9d (patch) | |
tree | 2ecc8ce4489281caec57b777d5d794e78bd8aa6f /crypto/p224.h | |
parent | f00c299976e4af12a0569275426780d5164f6899 (diff) | |
download | chromium_src-e22bd0de2f37b831db7c6a57543029a5aac9dd9d.zip chromium_src-e22bd0de2f37b831db7c6a57543029a5aac9dd9d.tar.gz chromium_src-e22bd0de2f37b831db7c6a57543029a5aac9dd9d.tar.bz2 |
Revert 108866 - crypto: add simple P224 implementation.
This is intended to be the underlying group for an EKE implementation for
Remoting.
BUG=none
TEST=crypto_unittests
Review URL: http://codereview.chromium.org/8431007
TBR=agl@chromium.org
Review URL: http://codereview.chromium.org/8467016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/p224.h')
-rw-r--r-- | crypto/p224.h | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/crypto/p224.h b/crypto/p224.h deleted file mode 100644 index 58dc0f1..0000000 --- a/crypto/p224.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CRYPTO_P224_H_ -#define CRYPTO_P224_H_ -#pragma once - -#include <string> - -#include "base/basictypes.h" -#include "base/string_piece.h" - -namespace crypto { - -// P224 implements an elliptic curve group, commonly known as P224 and defined -// in FIPS 186-3, section D.2.2. -namespace p224 { - -// An element of the field (ℤ/pℤ) is represented with 8, 28-bit limbs in -// little endian order. -typedef uint32 FieldElement[8]; - -struct Point { - // SetFromString the value of the point from the 56 byte, external - // representation. The external point representation is an (x, y) pair of a - // point on the curve. Each field element is represented as a big-endian - // number < p. - bool SetFromString(const base::StringPiece& in); - - // ToString returns an external representation of the Point. - std::string ToString() const; - - // An Point is represented in Jacobian form (x/z², y/z³). - FieldElement x, y, z; -}; - -// ScalarMult computes *out = in*scalar where scalar is a 28-byte, big-endian -// number. -void ScalarMult(const Point& in, const uint8* scalar, Point* out); - -// ScalarBaseMult computes *out = g*scalar where g is the base point of the -// curve and scalar is a 28-byte, big-endian number. -void ScalarBaseMult(const uint8* scalar, Point* out); - -// Add computes *out = a+b. -void Add(const Point& a, const Point& b, Point* out); - -// Negate calculates out = -a; -void Negate(const Point& a, Point* out); - -} // namespace p224 - -} // namespace crypto - -#endif // CRYPTO_P224_H_ |