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

Side by Side Diff: crypto/aead_openssl.h

Issue 1083493003: Encrypt certificate reports before uploading to HTTP URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add HKDF label, make Decrypt method static, add algorithm parameter, other tweaks Created 5 years, 8 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
« no previous file with comments | « chrome/browser/ui/bookmarks/bookmark_browsertest.cc ('k') | crypto/aead_openssl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 CRYPTO_AEAD_H_
6 #define CRYPTO_AEAD_H_
7
8 #include "base/strings/string_piece.h"
9 #include "crypto/crypto_export.h"
10
11 struct evp_aead_st;
estark 2015/04/22 03:55:31 This seems odd to me (forward-declaring the intern
12
13 namespace crypto {
14
15 // This class exposes the AES-128-CTR-HMAC-SHA256 AEAD, currently only
16 // for OpenSSL builds.
17 class CRYPTO_EXPORT Aead {
18 public:
19 enum AeadAlgorithm { AES_128_CTR_HMAC_SHA256 };
20
21 explicit Aead(AeadAlgorithm algorithm);
22
23 ~Aead();
24
25 void Init(const std::string* key);
26
27 bool Seal(const base::StringPiece& plaintext,
28 const base::StringPiece& nonce,
29 const base::StringPiece& additional_data,
30 std::string* ciphertext) const;
31
32 bool Open(const base::StringPiece& ciphertext,
33 const base::StringPiece& nonce,
34 const base::StringPiece& additional_data,
35 std::string* plaintext) const;
36
37 size_t KeyLength() const;
38
39 size_t NonceLength() const;
40
41 private:
42 const std::string* key_;
43 const evp_aead_st* aead_;
44 };
45
46 } // namespace crypto
47
48 #endif // CRYPTO_ENCRYPTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/bookmarks/bookmark_browsertest.cc ('k') | crypto/aead_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698