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

Side by Side Diff: content/child/webcrypto/crypto_data.h

Issue 797723006: Implement PBKDF2 (except for generateKey) using BoringSSL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pbkdf2
Patch Set: Throw OperationError on importing empty password Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_CHILD_WEBCRYPTO_CRYPTO_DATA_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_CRYPTO_DATA_H_
6 #define CONTENT_CHILD_WEBCRYPTO_CRYPTO_DATA_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_CRYPTO_DATA_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 18 matching lines...) Expand all
29 CryptoData(const unsigned char* bytes, unsigned int byte_length); 29 CryptoData(const unsigned char* bytes, unsigned int byte_length);
30 30
31 // These constructors do NOT copy the data. Hence the base pointer should 31 // These constructors do NOT copy the data. Hence the base pointer should
32 // remain valid for the lifetime of CryptoData. 32 // remain valid for the lifetime of CryptoData.
33 explicit CryptoData(const std::vector<unsigned char>& bytes); 33 explicit CryptoData(const std::vector<unsigned char>& bytes);
34 explicit CryptoData(const std::string& bytes); 34 explicit CryptoData(const std::string& bytes);
35 explicit CryptoData(const blink::WebVector<unsigned char>& bytes); 35 explicit CryptoData(const blink::WebVector<unsigned char>& bytes);
36 36
37 const unsigned char* bytes() const { return bytes_; } 37 const unsigned char* bytes() const { return bytes_; }
38 unsigned int byte_length() const { return byte_length_; } 38 unsigned int byte_length() const { return byte_length_; }
39 bool is_empty() const { return bytes_ == NULL || byte_length_ == 0; }
39 40
40 private: 41 private:
41 const unsigned char* const bytes_; 42 const unsigned char* const bytes_;
42 const unsigned int byte_length_; 43 const unsigned int byte_length_;
43 }; 44 };
44 45
45 } // namespace webcrypto 46 } // namespace webcrypto
46 47
47 } // namespace content 48 } // namespace content
48 49
49 #endif // CONTENT_CHILD_WEBCRYPTO_CRYPTO_DATA_H_ 50 #endif // CONTENT_CHILD_WEBCRYPTO_CRYPTO_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698