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 | db748d2 | 2023-09-19 11:18:29 +0000 | [diff] [blame] | 20 | #[cfg(feature = "alloc")] |
| 21 | extern crate alloc; |
| 22 | |
Alice Wang | 856d656 | 2023-02-03 13:51:08 +0000 | [diff] [blame] | 23 | #[cfg(not(feature = "std"))] |
| 24 | extern crate core as std; |
| 25 | |
Alice Wang | 9c40eca | 2023-02-03 13:10:24 +0000 | [diff] [blame] | 26 | mod bcc; |
Alice Wang | 0b9e110 | 2023-02-02 09:57:06 +0000 | [diff] [blame] | 27 | mod dice; |
Alice Wang | 856d656 | 2023-02-03 13:51:08 +0000 | [diff] [blame] | 28 | mod error; |
Alice Wang | 24954b4 | 2023-02-06 10:03:45 +0000 | [diff] [blame] | 29 | mod ops; |
Alice Wang | db748d2 | 2023-09-19 11:18:29 +0000 | [diff] [blame] | 30 | #[cfg(feature = "alloc")] |
Alice Wang | 9c40eca | 2023-02-03 13:10:24 +0000 | [diff] [blame] | 31 | mod retry; |
Alice Wang | 0b9e110 | 2023-02-02 09:57:06 +0000 | [diff] [blame] | 32 | |
Alice Wang | 1a933a8 | 2023-02-14 11:02:51 +0000 | [diff] [blame] | 33 | pub use bcc::{ |
| 34 | bcc_format_config_descriptor, bcc_handover_main_flow, bcc_handover_parse, bcc_main_flow, |
Alan Stokes | 82b1239 | 2023-08-22 14:39:29 +0100 | [diff] [blame] | 35 | BccHandover, DiceConfigValues, |
Alice Wang | 1a933a8 | 2023-02-14 11:02:51 +0000 | [diff] [blame] | 36 | }; |
Alice Wang | 3213d49 | 2023-02-03 15:52:18 +0000 | [diff] [blame] | 37 | pub use dice::{ |
Alice Wang | 44f48b2 | 2023-02-09 09:51:22 +0000 | [diff] [blame] | 38 | derive_cdi_certificate_id, derive_cdi_private_key_seed, dice_main_flow, Cdi, CdiValues, Config, |
Alice Wang | f59662d | 2023-02-10 16:07:56 +0000 | [diff] [blame] | 39 | DiceArtifacts, DiceMode, Hash, Hidden, InlineConfig, InputValues, PrivateKey, PrivateKeySeed, |
| 40 | PublicKey, Signature, CDI_SIZE, HASH_SIZE, HIDDEN_SIZE, ID_SIZE, PRIVATE_KEY_SEED_SIZE, |
Alice Wang | 3213d49 | 2023-02-03 15:52:18 +0000 | [diff] [blame] | 41 | }; |
Alice Wang | ef99924 | 2023-05-22 11:14:59 +0000 | [diff] [blame] | 42 | pub use error::{DiceError, Result}; |
Alice Wang | f59662d | 2023-02-10 16:07:56 +0000 | [diff] [blame] | 43 | pub use ops::{generate_certificate, hash, kdf, keypair_from_seed, sign, verify}; |
Alice Wang | db748d2 | 2023-09-19 11:18:29 +0000 | [diff] [blame] | 44 | #[cfg(feature = "alloc")] |
Alice Wang | 44f48b2 | 2023-02-09 09:51:22 +0000 | [diff] [blame] | 45 | pub use retry::{ |
| 46 | retry_bcc_format_config_descriptor, retry_bcc_main_flow, retry_dice_main_flow, |
Alice Wang | 4d61177 | 2023-02-13 09:45:21 +0000 | [diff] [blame] | 47 | retry_generate_certificate, OwnedDiceArtifacts, |
Alice Wang | 44f48b2 | 2023-02-09 09:51:22 +0000 | [diff] [blame] | 48 | }; |