hsmtool/util/mod.rs
1// Copyright lowRISC contributors (OpenTitan project).
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5pub mod attribute;
6pub mod ef;
7pub mod escape;
8pub mod helper;
9pub mod key;
10pub mod secret;
11pub mod signing;
12pub mod wrap;
13
14/// The `testdata` function can be used in tests to reference testdata directories.
15#[cfg(test)]
16pub fn testdata(test: &str) -> std::path::PathBuf {
17 let mut path: std::path::PathBuf = std::env::var_os("TESTDATA").unwrap().into();
18 // TESTDATA points an arbitrary test, remove two levels to get the directory.
19 path.pop();
20 path.pop();
21 path.push(test);
22 path
23}