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

Unified Diff: base/security/rsa.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months 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 | « base/security/rc4.c ('k') | base/security/rsa.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/security/rsa.h
diff --git a/base/security/rsa.h b/base/security/rsa.h
deleted file mode 100644
index 3403c11119e892b32dfaebc0d09ec2c31f574afd..0000000000000000000000000000000000000000
--- a/base/security/rsa.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2006-2009 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-
-#ifndef OMAHA_COMMON_SECURITY_RSA_H__
-#define OMAHA_COMMON_SECURITY_RSA_H__
-
-#include <inttypes.h>
-
-class RSA {
- public:
- typedef const uint32_t PublicKeyInstance[];
- typedef const uint32_t* PublicKey;
-
- // Public_key as montgomery precomputed array
- explicit RSA(PublicKey public_key) : pkey_(public_key) {}
-
- // Verifies a Google style RSA message recovery signature.
- //
- // sig[] signature to verify, big-endian byte array.
- // sig_len length of sig[] in bytes.
- // If verified successfully, output receives the recovered
- // message and the function returns the number of bytes.
- // If not successful, the function returns 0.
- // (empty message is not a useful message)
- int verify(const uint8_t* sig, int sig_len,
- void* output, int output_max) const;
-
- // Hybrid encrypt message.
- //
- // output_max should be at least encryptedSize(msg_len)
- // Returns 0 on failure, # output bytes on success.
- int encrypt(const uint8_t* msg, int msg_len,
- const void* seed, int seed_len,
- uint8_t* output, int output_max) const;
-
- int encryptedSize(int len) const {
- return len + 1 + 4 + size();
- }
-
- // Performs in-place public key exponentiation.
- //
- // Input_len should match size of modulus in bytes.
- // Returns 0 on failure, # of bytes written on success.
- int raw(uint8_t* input, int input_len) const;
-
- int version() const { return pkey_[0]; }
- int size() const { return pkey_[1] * 4; }
-
- private:
- const PublicKey pkey_;
- static const int kMaxWords = 64;
-};
-
-#endif // OMAHA_COMMON_SECURITY_RSA_H__
« no previous file with comments | « base/security/rc4.c ('k') | base/security/rsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698