1 // Copyright 2020 Google LLC 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 #ifndef TINK_CONFIG_TINK_FIPS_H_ 17 #define TINK_CONFIG_TINK_FIPS_H_ 18 19 #include "absl/base/attributes.h" 20 #include "openssl/crypto.h" 21 #include "tink/internal/fips_utils.h" 22 #include "tink/util/status.h" 23 24 namespace crypto { 25 namespace tink { 26 27 // This function will return true if Tink has been built in FIPS mode or if 28 // the FIPS restrictions have been enabled at runtime. 29 bool IsFipsModeEnabled(); 30 31 // Enables the FIPS restrictions for the registry and subtle primitives. If Tink 32 // has been built in FIPS this is redundant. This method must be called before 33 // handling any key material or calling any of the functions in subtle. 34 crypto::tink::util::Status RestrictToFips(); 35 36 } // namespace tink 37 } // namespace crypto 38 39 #endif // TINK_CONFIG_TINK_FIPS_H_ 40