mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-23 16:04:46 +02:00
chore: split-out vault code from teepot
in teepot-vault
Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
63c16b1177
commit
f8bd9e6a08
61 changed files with 450 additions and 308 deletions
24
crates/teepot-vault/src/lib.rs
Normal file
24
crates/teepot-vault/src/lib.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright (c) 2023-2025 Matter Labs
|
||||
|
||||
//! Helper functions to verify Intel SGX enclaves and other TEEs.
|
||||
|
||||
#![deny(missing_docs)]
|
||||
#![deny(clippy::all)]
|
||||
|
||||
pub mod client;
|
||||
pub mod json;
|
||||
pub mod server;
|
||||
pub mod tdx;
|
||||
|
||||
/// pad a byte slice to a fixed sized array
|
||||
pub fn pad<const T: usize>(input: &[u8]) -> [u8; T] {
|
||||
let mut output = [0; T];
|
||||
let len = input.len();
|
||||
if len > T {
|
||||
output.copy_from_slice(&input[..T]);
|
||||
} else {
|
||||
output[..len].copy_from_slice(input);
|
||||
}
|
||||
output
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue