aboutsummaryrefslogtreecommitdiff
path: root/src/tpm/tpm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tpm/tpm.h')
-rw-r--r--src/tpm/tpm.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/tpm/tpm.h b/src/tpm/tpm.h
new file mode 100644
index 0000000..7531ae2
--- /dev/null
+++ b/src/tpm/tpm.h
@@ -0,0 +1,33 @@
+// Copyright 2026 Osmium Sorcerer
+// SPDX-License-Identifier: MIT
+
+#ifndef SOF_AO2CLIENT_TPM_TPM_H
+#define SOF_AO2CLIENT_TPM_TPM_H
+
+#include <stdint.h>
+#include <stddef.h>
+
+typedef enum {
+ STKB_SUCCESS,
+ STKB_ERROR,
+ STKB_TPM_UNAVAILABLE,
+ STKB_BAD_PIN,
+ STKB_AUTH_FAILURE,
+ STKB_LOCKOUT,
+} stkb_rc;
+
+typedef struct {
+ const uint8_t *pin;
+ size_t pin_len;
+ const wchar_t *key_name;
+} stkb_user_input;
+
+stkb_rc tpm2_init(void);
+
+stkb_rc tpm2_keygen(uint8_t *out_pub, uint8_t *out_buffer, size_t buffer_size,
+ size_t *written, stkb_user_input input);
+
+stkb_rc tpm2_compute_ss(uint8_t *ss, const uint8_t *blob, size_t blob_len,
+ const uint8_t *pk, stkb_user_input input);
+
+#endif /* SOF_AO2CLIENT_TPM_TPM_H */