1 // Copyright 2017 Google Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // 15 /////////////////////////////////////////////////////////////////////////////// 16 17 #ifndef TINK_SUBTLE_AES_GCM_BORINGSSL_H_ 18 #define TINK_SUBTLE_AES_GCM_BORINGSSL_H_ 19 20 #include <memory> 21 #include <utility> 22 23 #include "absl/strings/string_view.h" 24 #include "tink/aead.h" 25 #include "tink/internal/fips_utils.h" 26 #include "tink/util/secret_data.h" 27 #include "tink/util/statusor.h" 28 29 namespace crypto { 30 namespace tink { 31 namespace subtle { 32 33 class AesGcmBoringSsl { 34 public: 35 ABSL_DEPRECATED("Use AesGcmBoringSsl::New(const util::SecretData&) instead.") New(absl::string_view key_value)36 static crypto::tink::util::StatusOr<std::unique_ptr<Aead>> New( 37 absl::string_view key_value) { 38 return AesGcmBoringSsl::New(util::SecretDataFromStringView(key_value)); 39 } 40 41 static crypto::tink::util::StatusOr<std::unique_ptr<Aead>> New( 42 const util::SecretData& key); 43 44 static constexpr crypto::tink::internal::FipsCompatibility kFipsStatus = 45 crypto::tink::internal::FipsCompatibility::kRequiresBoringCrypto; 46 }; 47 48 } // namespace subtle 49 } // namespace tink 50 } // namespace crypto 51 52 #endif // TINK_SUBTLE_AES_GCM_BORINGSSL_H_ 53