Alice Wang | 0b9e110 | 2023-02-02 09:57:06 +0000 | [diff] [blame] | 1 | // Copyright 2023, The Android Open Source Project |
| 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 | //! Implements safe wrappers around the public API of libopen-dice for |
| 16 | //! both std and nostd usages. |
| 17 | |
| 18 | #![cfg_attr(not(feature = "std"), no_std)] |
| 19 | |
Alice Wang | 856d656 | 2023-02-03 13:51:08 +0000 | [diff] [blame] | 20 | #[cfg(not(feature = "std"))] |
| 21 | extern crate core as std; |
| 22 | |
Alice Wang | 9c40eca | 2023-02-03 13:10:24 +0000 | [diff] [blame] | 23 | mod bcc; |
Alice Wang | 0b9e110 | 2023-02-02 09:57:06 +0000 | [diff] [blame] | 24 | mod dice; |
Alice Wang | 856d656 | 2023-02-03 13:51:08 +0000 | [diff] [blame] | 25 | mod error; |
Alice Wang | 24954b4 | 2023-02-06 10:03:45 +0000 | [diff] [blame] | 26 | mod ops; |
Alice Wang | 9c40eca | 2023-02-03 13:10:24 +0000 | [diff] [blame] | 27 | #[cfg(feature = "std")] |
| 28 | mod retry; |
Alice Wang | 0b9e110 | 2023-02-02 09:57:06 +0000 | [diff] [blame] | 29 | |
Alice Wang | f4bd1c6 | 2023-02-08 08:38:44 +0000 | [diff] [blame^] | 30 | pub use bcc::{bcc_format_config_descriptor, bcc_main_flow}; |
Alice Wang | 3213d49 | 2023-02-03 15:52:18 +0000 | [diff] [blame] | 31 | pub use dice::{ |
Alice Wang | f4bd1c6 | 2023-02-08 08:38:44 +0000 | [diff] [blame^] | 32 | derive_cdi_certificate_id, derive_cdi_private_key_seed, Cdi, CdiValues, Config, DiceMode, Hash, |
| 33 | Hidden, InlineConfig, InputValues, PrivateKeySeed, CDI_SIZE, HASH_SIZE, HIDDEN_SIZE, ID_SIZE, |
Alice Wang | 7cc5956 | 2023-02-08 13:17:10 +0000 | [diff] [blame] | 34 | PRIVATE_KEY_SEED_SIZE, |
Alice Wang | 3213d49 | 2023-02-03 15:52:18 +0000 | [diff] [blame] | 35 | }; |
Alice Wang | 856d656 | 2023-02-03 13:51:08 +0000 | [diff] [blame] | 36 | pub use error::{check_result, DiceError, Result}; |
Alice Wang | 24954b4 | 2023-02-06 10:03:45 +0000 | [diff] [blame] | 37 | pub use ops::hash; |
Alice Wang | 9c40eca | 2023-02-03 13:10:24 +0000 | [diff] [blame] | 38 | #[cfg(feature = "std")] |
Alice Wang | f4bd1c6 | 2023-02-08 08:38:44 +0000 | [diff] [blame^] | 39 | pub use retry::{retry_bcc_format_config_descriptor, retry_bcc_main_flow, OwnedDiceArtifacts}; |