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

Side by Side Diff: base/secure_hash.h

Issue 6276002: Abstracts SHA256 context for NSS / OpenSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moves to SecureHash (and other comments) Created 9 years, 11 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
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_SECURE_HASH_H_
6 #define BASE_SECURE_HASH_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "base/sha2.h"
wtc 2011/01/25 19:06:43 This file should not need to include the header fo
bulach 2011/01/25 20:33:41 Done.
13
14 namespace base {
15
16 // A wrapper for calculating secure hashes when the full string is not known in
17 // advance.
wtc 2011/01/25 19:06:43 Remove "when the full string is not known in advan
bulach 2011/01/25 20:33:41 I rewrote the sentence, please let me know if it's
18 class SecureHash {
19 public:
20 enum Type {
wtc 2011/01/25 19:06:43 This enum should be named Algorithm. The constant
bulach 2011/01/25 20:33:41 Done.
21 TYPE_SHA256,
22 };
23 virtual ~SecureHash() {}
24
25 static SecureHash* Create(Type type);
26
27 virtual void Update(const std::string& str) = 0;
28 virtual void Finish(void* output, size_t len) = 0;
29
30 protected:
31 SecureHash() {}
32
33 private:
34 DISALLOW_COPY_AND_ASSIGN(SecureHash);
35 };
36
37 } // namespace base
38
39 #endif // BASE_SECURE_HASH_H_
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/secure_hash_nss.cc » ('j') | base/secure_hash_nss.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698