blob: f76494e69a340987a14f8b7c925b60fd0d924e43 [file] [log] [blame]
Alice Wang0b9e1102023-02-02 09:57:06 +00001// 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 Wang856d6562023-02-03 13:51:08 +000020#[cfg(not(feature = "std"))]
21extern crate core as std;
22
Alice Wang9c40eca2023-02-03 13:10:24 +000023mod bcc;
Alice Wang0b9e1102023-02-02 09:57:06 +000024mod dice;
Alice Wang856d6562023-02-03 13:51:08 +000025mod error;
Alice Wang24954b42023-02-06 10:03:45 +000026mod ops;
Alice Wang9c40eca2023-02-03 13:10:24 +000027#[cfg(feature = "std")]
28mod retry;
Alice Wang0b9e1102023-02-02 09:57:06 +000029
Alice Wangf4bd1c62023-02-08 08:38:44 +000030pub use bcc::{bcc_format_config_descriptor, bcc_main_flow};
Alice Wang3213d492023-02-03 15:52:18 +000031pub use dice::{
Alice Wang44f48b22023-02-09 09:51:22 +000032 derive_cdi_certificate_id, derive_cdi_private_key_seed, dice_main_flow, Cdi, CdiValues, Config,
33 DiceMode, Hash, Hidden, InlineConfig, InputValues, PrivateKeySeed, CDI_SIZE, HASH_SIZE,
34 HIDDEN_SIZE, ID_SIZE, PRIVATE_KEY_SEED_SIZE,
Alice Wang3213d492023-02-03 15:52:18 +000035};
Alice Wang856d6562023-02-03 13:51:08 +000036pub use error::{check_result, DiceError, Result};
Alice Wang6ef44bc2023-02-08 12:08:32 +000037pub use ops::{hash, kdf};
Alice Wang9c40eca2023-02-03 13:10:24 +000038#[cfg(feature = "std")]
Alice Wang44f48b22023-02-09 09:51:22 +000039pub use retry::{
40 retry_bcc_format_config_descriptor, retry_bcc_main_flow, retry_dice_main_flow,
41 OwnedDiceArtifacts,
42};