diff options
Diffstat (limited to 'src/key_derivation.h')
-rw-r--r-- | src/key_derivation.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/key_derivation.h b/src/key_derivation.h index 2f1bfb5..d045527 100644 --- a/src/key_derivation.h +++ b/src/key_derivation.h @@ -69,13 +69,16 @@ struct key_derivation_struct { }; typedef struct key_derivation_struct key_derivation_t; -int key_derivation_init(key_derivation_t* kd, const char* type, int8_t ld_kdr, u_int8_t* key, u_int32_t key_len, u_int8_t* salt, u_int32_t salt_len); +int key_derivation_init(key_derivation_t* kd, const char* type, int8_t ld_kdr, const char* passphrase, u_int8_t* key, u_int32_t key_len, u_int8_t* salt, u_int32_t salt_len); +int key_derivation_generate_master_key(key_derivation_t* kd, const char* passphrase, u_int16_t key_length); +int key_derivation_generate_master_salt(key_derivation_t* kd, const char* passphrase, u_int16_t salt_length); void key_derivation_close(key_derivation_t* kd); int key_derivation_generate(key_derivation_t* kd, satp_prf_label_t label, seq_nr_t seq_nr, u_int8_t* key, u_int32_t len); int key_derivation_null_generate(u_int8_t* key, u_int32_t len); +#define KD_AESCTR_DEFAULT_KEY_LENGTH 128 #define KD_AESCTR_CTR_LENGTH 16 #define KD_AESCTR_SALT_LENGTH 14 @@ -115,7 +118,7 @@ struct key_derivation_aesctr_param_struct { }; typedef struct key_derivation_aesctr_param_struct key_derivation_aesctr_param_t; -int key_derivation_aesctr_init(key_derivation_t* kd); +int key_derivation_aesctr_init(key_derivation_t* kd, const char* passphrase); void key_derivation_aesctr_close(key_derivation_t* kd); int key_derivation_aesctr_calc_ctr(key_derivation_t* kd, seq_nr_t* r, satp_prf_label_t label, seq_nr_t seq_nr); int key_derivation_aesctr_generate(key_derivation_t* kd, satp_prf_label_t label, seq_nr_t seq_nr, u_int8_t* key, u_int32_t len); |