[crypto] Split KDF operations from monolithic header.
Next step in splitting api.h into many files; separate out all
KDF-specific datatypes and functions.
Code has only been moved in this commit, not changed.
Signed-off-by: Jade Philipoom <jadep@google.com>
diff --git a/sw/device/lib/crypto/include/api.h b/sw/device/lib/crypto/include/api.h
index bb1e9a6..a0fd99e 100644
--- a/sw/device/lib/crypto/include/api.h
+++ b/sw/device/lib/crypto/include/api.h
@@ -17,36 +17,6 @@
#endif // __cplusplus
/**
- * Enum to define the supported KDF constructions.
- *
- * Values are hardened.
- */
-typedef enum kdf_type {
- // KDF construction with HMAC as a PRF.
- kKdfTypeHmac = 0xfa3b,
- // KDF construction with KMAC as a PRF.
- kKdfTypeKmac = 0x0f47,
-} kdf_type_t;
-
-/**
- * Performs the key derivation function in counter mode.
- *
- * The required PRF engine for the KDF function is selected using the
- * `kdf_mode` parameter.
- *
- * @param key_derivation_key Pointer to the blinded key derivation key
- * @param kdf_mode Required KDF mode, with HMAC or KMAC as a PRF
- * @param key_mode Crypto mode for which the derived key is intended
- * @param required_bit_len Required length of the derived key in bits
- * @param keying_material Pointer to the blinded keying material
- * @return Result of the key derivation operation
- */
-crypto_status_t otcrypto_kdf_ctr(const crypto_blinded_key_t key_derivation_key,
- kdf_type_t kdf_mode, key_mode_t key_mode,
- size_t required_bit_len,
- crypto_blinded_key_t keying_material);
-
-/**
* Builds an unblinded key struct from a user (plain) key.
*
* @param plain_key Pointer to the user defined plain key
diff --git a/sw/device/lib/crypto/include/kdf.h b/sw/device/lib/crypto/include/kdf.h
index 2213880..bddfdc6 100644
--- a/sw/device/lib/crypto/include/kdf.h
+++ b/sw/device/lib/crypto/include/kdf.h
@@ -16,6 +16,36 @@
extern "C" {
#endif // __cplusplus
+/**
+ * Enum to define the supported KDF constructions.
+ *
+ * Values are hardened.
+ */
+typedef enum kdf_type {
+ // KDF construction with HMAC as a PRF.
+ kKdfTypeHmac = 0xfa3b,
+ // KDF construction with KMAC as a PRF.
+ kKdfTypeKmac = 0x0f47,
+} kdf_type_t;
+
+/**
+ * Performs the key derivation function in counter mode.
+ *
+ * The required PRF engine for the KDF function is selected using the
+ * `kdf_mode` parameter.
+ *
+ * @param key_derivation_key Pointer to the blinded key derivation key
+ * @param kdf_mode Required KDF mode, with HMAC or KMAC as a PRF
+ * @param key_mode Crypto mode for which the derived key is intended
+ * @param required_bit_len Required length of the derived key in bits
+ * @param keying_material Pointer to the blinded keying material
+ * @return Result of the key derivation operation
+ */
+crypto_status_t otcrypto_kdf_ctr(const crypto_blinded_key_t key_derivation_key,
+ kdf_type_t kdf_mode, key_mode_t key_mode,
+ size_t required_bit_len,
+ crypto_blinded_key_t keying_material);
+
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus