Remove duplicate "now" function

We also have this functionality in util, no need to copy it.
This commit is contained in:
Johannes Bauer 2019-10-25 16:21:37 +02:00
parent 6ac94dbd83
commit 54063ec025

10
vault.c
View File

@ -29,6 +29,7 @@
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#include "vault.h" #include "vault.h"
#include "util.h"
static bool vault_derive_key(const struct vault_t *vault, uint8_t key[static 32]) { static bool vault_derive_key(const struct vault_t *vault, uint8_t key[static 32]) {
/* Derive the AES key from it */ /* Derive the AES key from it */
@ -38,15 +39,6 @@ static bool vault_derive_key(const struct vault_t *vault, uint8_t key[static 32]
return true; return true;
} }
static double now(void) {
struct timeval tv;
if (gettimeofday(&tv, NULL) == 0) {
return tv.tv_sec + (1e-6 * tv.tv_usec);
} else {
return 0;
}
}
static double vault_measure_key_derivation_time(struct vault_t *vault, unsigned int new_iteration_count) { static double vault_measure_key_derivation_time(struct vault_t *vault, unsigned int new_iteration_count) {
uint8_t dkey[32]; uint8_t dkey[32];
double t0, t1; double t0, t1;