Debian Codegraph @

third_party/rust/authenticator/src/crypto/dummy.rs

raw
1 use super::CryptoError;
2
3 /*
4 This is a dummy implementation for CI, to avoid having to install NSS or openSSL in the CI-pipeline
5 */
6
7 pub type Result<T> = std::result::Result<T, CryptoError>;
8
9 pub fn ecdhe_p256_raw(_peer_spki: &[u8]) -> Result<(Vec<u8>, Vec<u8>)> {
10 unimplemented!()
11 }
12
13 pub fn encrypt_aes_256_cbc_no_pad(
14 _key: &[u8],
15 _iv: Option<&[u8]>,
16 _data: &[u8],
17 ) -> Result<Vec<u8>> {
18 unimplemented!()
19 }
20
21 pub fn decrypt_aes_256_cbc_no_pad(
22 _key: &[u8],
23 _iv: Option<&[u8]>,
24 _data: &[u8],
25 ) -> Result<Vec<u8>> {
26 unimplemented!()
27 }
28
29 pub fn hmac_sha256(_key: &[u8], _data: &[u8]) -> Result<Vec<u8>> {
30 unimplemented!()
31 }
32
33 pub fn sha256(_data: &[u8]) -> Result<Vec<u8>> {
34 unimplemented!()
35 }
36
37 pub fn random_bytes(_count: usize) -> Result<Vec<u8>> {
38 unimplemented!()
39 }
40
41 pub fn gen_p256() -> Result<(Vec<u8>, Vec<u8>)> {
42 unimplemented!()
43 }
44
45 pub fn ecdsa_p256_sha256_sign_raw(_private: &[u8], _data: &[u8]) -> Result<Vec<u8>> {
46 unimplemented!()
47 }
48
49 #[allow(dead_code)]
50 #[cfg(test)]
51 pub fn test_ecdsa_p256_sha256_verify_raw(
52 _public: &[u8],
53 _signature: &[u8],
54 _data: &[u8],
55 ) -> Result<()> {
56 unimplemented!()
57 }