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

Side by Side Diff: crypto/hmac.h

Issue 8124011: Add constant-time comparison operators for cryptographic uses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | crypto/hmac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Utility class for calculating the HMAC for a given message. We currently 5 // Utility class for calculating the HMAC for a given message. We currently
6 // only support SHA1 for the hash algorithm, but this can be extended easily. 6 // only support SHA1 for the hash algorithm, but this can be extended easily.
7 7
8 #ifndef CRYPTO_HMAC_H_ 8 #ifndef CRYPTO_HMAC_H_
9 #define CRYPTO_HMAC_H_ 9 #define CRYPTO_HMAC_H_
10 #pragma once 10 #pragma once
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const base::StringPiece& data, 71 const base::StringPiece& data,
72 const base::StringPiece& digest) const WARN_UNUSED_RESULT; 72 const base::StringPiece& digest) const WARN_UNUSED_RESULT;
73 73
74 private: 74 private:
75 HashAlgorithm hash_alg_; 75 HashAlgorithm hash_alg_;
76 scoped_ptr<HMACPlatformData> plat_; 76 scoped_ptr<HMACPlatformData> plat_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(HMAC); 78 DISALLOW_COPY_AND_ASSIGN(HMAC);
79 }; 79 };
80 80
81 bool SecureMemcmp(const void* s1, const void* s2, size_t n);
wtc 2011/10/04 00:32:10 This function is not related to HMAC. We should c
82
81 } // namespace crypto 83 } // namespace crypto
82 84
83 #endif // CRYPTO_HMAC_H_ 85 #endif // CRYPTO_HMAC_H_
OLDNEW
« no previous file with comments | « no previous file | crypto/hmac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698