Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |