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

Unified Diff: crypto/secure_hash.h

Issue 8588057: Added serialization to SecureHash. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added iterator to Deserialize, applied comments from agl. Created 9 years, 1 month 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 | « no previous file | crypto/secure_hash_default.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/secure_hash.h
diff --git a/crypto/secure_hash.h b/crypto/secure_hash.h
index 8a0f6ae66e1ea7f4edea01120ab42e70e73add1a..4a49380334d5c182679d6c1355036e2609283a2b 100644
--- a/crypto/secure_hash.h
+++ b/crypto/secure_hash.h
@@ -9,6 +9,8 @@
#include "base/basictypes.h"
#include "crypto/crypto_export.h"
+class Pickle;
+
namespace crypto {
// A wrapper to calculate secure hashes incrementally, allowing to
@@ -25,6 +27,17 @@ class CRYPTO_EXPORT SecureHash {
virtual void Update(const void* input, size_t len) = 0;
virtual void Finish(void* output, size_t len) = 0;
+ // Serialize the context, so it can be restored at a later time.
+ // |pickle| will contain the serialized data.
+ // Returns whether or not |pickle| was filled.
+ virtual bool Serialize(Pickle* pickle) = 0;
+
+ // Restore the context that was saved earlier.
+ // |data_iterator| allows this to be used as part of a larger pickle.
+ // |pickle| holds the saved data.
+ // Returns success or failure.
+ virtual bool Deserialize(void** data_iterator, Pickle* pickle) = 0;
+
protected:
SecureHash() {}
« no previous file with comments | « no previous file | crypto/secure_hash_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698