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

Unified Diff: net/quic/crypto/aes_128_gcm_12_decrypter.h

Issue 189893002: Add ChaCha20Poly1305Encrypter, based on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove the six svn copy files from the CL Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/net.gyp ('k') | net/quic/crypto/aes_128_gcm_12_decrypter_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/aes_128_gcm_12_decrypter.h
===================================================================
--- net/quic/crypto/aes_128_gcm_12_decrypter.h (revision 255481)
+++ net/quic/crypto/aes_128_gcm_12_decrypter.h (working copy)
@@ -5,28 +5,17 @@
#ifndef NET_QUIC_CRYPTO_AES_128_GCM_12_DECRYPTER_H_
#define NET_QUIC_CRYPTO_AES_128_GCM_12_DECRYPTER_H_
-#include <string>
+#include "net/quic/crypto/aead_base_decrypter.h"
-#include "base/compiler_specific.h"
-#include "net/quic/crypto/quic_decrypter.h"
-
-#if defined(USE_OPENSSL)
-#include "net/quic/crypto/scoped_evp_aead_ctx.h"
-#endif
-
namespace net {
-namespace test {
-class Aes128Gcm12DecrypterPeer;
-} // namespace test
-
// An Aes128Gcm12Decrypter is a QuicDecrypter that implements the
// AEAD_AES_128_GCM_12 algorithm specified in RFC 5282. Create an instance by
// calling QuicDecrypter::Create(kAESG).
//
// It uses an authentication tag of 12 bytes (96 bits). The fixed prefix
// of the nonce is four bytes.
-class NET_EXPORT_PRIVATE Aes128Gcm12Decrypter : public QuicDecrypter {
+class NET_EXPORT_PRIVATE Aes128Gcm12Decrypter : public AeadBaseDecrypter {
public:
enum {
// Authentication tags are truncated to 96 bits.
@@ -36,31 +25,13 @@
Aes128Gcm12Decrypter();
virtual ~Aes128Gcm12Decrypter();
- // Returns true if the underlying crypto library supports AES GCM.
- static bool IsSupported();
-
- // QuicDecrypter implementation
- virtual bool SetKey(base::StringPiece key) OVERRIDE;
- virtual bool SetNoncePrefix(base::StringPiece nonce_prefix) OVERRIDE;
- virtual bool Decrypt(base::StringPiece nonce,
- base::StringPiece associated_data,
- base::StringPiece ciphertext,
- unsigned char* output,
- size_t* output_length) OVERRIDE;
- virtual QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
- base::StringPiece associated_data,
- base::StringPiece ciphertext) OVERRIDE;
- virtual base::StringPiece GetKey() const OVERRIDE;
- virtual base::StringPiece GetNoncePrefix() const OVERRIDE;
-
- private:
- // The 128-bit AES key.
- unsigned char key_[16];
- // The nonce prefix.
- unsigned char nonce_prefix_[4];
-
-#if defined(USE_OPENSSL)
- ScopedEVPAEADCtx ctx_;
+#if !defined(USE_OPENSSL)
+ protected:
+ // AeadBaseDecrypter methods:
+ virtual void FillAeadParams(base::StringPiece nonce,
+ base::StringPiece associated_data,
+ size_t auth_tag_size,
+ AeadParams* aead_params) const OVERRIDE;
#endif
};
« no previous file with comments | « net/net.gyp ('k') | net/quic/crypto/aes_128_gcm_12_decrypter_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698