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

Side by Side Diff: components/gcm_driver/crypto/gcm_message_cryptographer.h

Issue 1910903002: Remove *_openssl files for gcm_driver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment. Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 COMPONENTS_GCM_DRIVER_CRYPTO_GCM_MESSAGE_CRYPTOGRAPHER_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_CRYPTO_GCM_MESSAGE_CRYPTOGRAPHER_H_
6 #define COMPONENTS_GCM_DRIVER_CRYPTO_GCM_MESSAGE_CRYPTOGRAPHER_H_ 6 #define COMPONENTS_GCM_DRIVER_CRYPTO_GCM_MESSAGE_CRYPTOGRAPHER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <string> 10 #include <string>
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 FRIEND_TEST_ALL_PREFIXES(GCMMessageCryptographerTest, InvalidRecordPadding); 76 FRIEND_TEST_ALL_PREFIXES(GCMMessageCryptographerTest, InvalidRecordPadding);
77 FRIEND_TEST_ALL_PREFIXES(GCMMessageCryptographerTest, NonceGeneration); 77 FRIEND_TEST_ALL_PREFIXES(GCMMessageCryptographerTest, NonceGeneration);
78 friend class GCMMessageCryptographerReferenceTest; 78 friend class GCMMessageCryptographerReferenceTest;
79 79
80 // Size, in bytes, of the authentication tag included in the messages. 80 // Size, in bytes, of the authentication tag included in the messages.
81 static const size_t kAuthenticationTagBytes; 81 static const size_t kAuthenticationTagBytes;
82 82
83 enum Mode { ENCRYPT, DECRYPT }; 83 enum Mode { ENCRYPT, DECRYPT };
84 84
85 // Private implementation of the encryption and decryption routines, provided 85 // Private implementation of the encryption and decryption routines, provided
86 // by either NSS or BoringSSL depending on the platform. 86 // by BoringSSL.
87 bool EncryptDecryptRecordInternal(Mode mode, 87 bool EncryptDecryptRecordInternal(Mode mode,
88 const base::StringPiece& input, 88 const base::StringPiece& input,
89 const base::StringPiece& key, 89 const base::StringPiece& key,
90 const base::StringPiece& nonce, 90 const base::StringPiece& nonce,
91 std::string* output) const; 91 std::string* output) const;
92 92
93 // Derives the pseuro random key (PRK) to use for deriving the content 93 // Derives the pseuro random key (PRK) to use for deriving the content
94 // encryption key and the nonce. If |auth_secret_| is not the empty string, 94 // encryption key and the nonce. If |auth_secret_| is not the empty string,
95 // another HKDF will be invoked between the |key| and the |auth_secret_|. 95 // another HKDF will be invoked between the |key| and the |auth_secret_|.
96 std::string DerivePseudoRandomKey(const base::StringPiece& ikm) const; 96 std::string DerivePseudoRandomKey(const base::StringPiece& ikm) const;
(...skipping 20 matching lines...) Expand all
117 bool allow_empty_auth_secret_for_tests_ = false; 117 bool allow_empty_auth_secret_for_tests_ = false;
118 118
119 void set_allow_empty_auth_secret_for_tests(bool value) { 119 void set_allow_empty_auth_secret_for_tests(bool value) {
120 allow_empty_auth_secret_for_tests_ = value; 120 allow_empty_auth_secret_for_tests_ = value;
121 } 121 }
122 }; 122 };
123 123
124 } // namespace gcm 124 } // namespace gcm
125 125
126 #endif // COMPONENTS_GCM_DRIVER_CRYPTO_GCM_MESSAGE_CRYPTOGRAPHER_H_ 126 #endif // COMPONENTS_GCM_DRIVER_CRYPTO_GCM_MESSAGE_CRYPTOGRAPHER_H_
OLDNEW
« no previous file with comments | « components/gcm_driver/crypto/BUILD.gn ('k') | components/gcm_driver/crypto/gcm_message_cryptographer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698