diff options
Diffstat (limited to 'common/fpsensor/fpsensor_state.c')
-rw-r--r-- | common/fpsensor/fpsensor_state.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/common/fpsensor/fpsensor_state.c b/common/fpsensor/fpsensor_state.c index 2d59670c60..db64110b56 100644 --- a/common/fpsensor/fpsensor_state.c +++ b/common/fpsensor/fpsensor_state.c @@ -16,19 +16,18 @@ #include "util.h" /* Last acquired frame (aligned as it is used by arbitrary binary libraries) */ -uint8_t fp_buffer[FP_SENSOR_IMAGE_MAX_SIZE] FP_FRAME_SECTION __aligned(4); +uint8_t fp_buffer[FP_SENSOR_IMAGE_SIZE] FP_FRAME_SECTION __aligned(4); /* Fingers templates for the current user */ -uint8_t fp_template[FP_ALGORITHM_TEMPLATE_MAX_SIZE * - FP_MAX_FINGER_COUNT] FP_TEMPLATE_SECTION; +uint8_t fp_template[FP_MAX_FINGER_COUNT][FP_ALGORITHM_TEMPLATE_SIZE] + FP_TEMPLATE_SECTION; /* Encryption/decryption buffer */ /* TODO: On-the-fly encryption/decryption without a dedicated buffer */ /* * Store the encryption metadata at the beginning of the buffer containing the * ciphered data. */ -uint8_t fp_enc_buffer - [FP_ALGORITHM_ENCRYPTED_TEMPLATE_MAX_SIZE] FP_TEMPLATE_SECTION; - +uint8_t fp_enc_buffer[FP_ALGORITHM_ENCRYPTED_TEMPLATE_SIZE] + FP_TEMPLATE_SECTION; /* Salt used in derivation of positive match secret. */ uint8_t fp_positive_match_salt [FP_MAX_FINGER_COUNT][FP_POSITIVE_MATCH_SALT_BYTES]; @@ -66,8 +65,7 @@ void fp_task_simulate(void) void fp_clear_finger_context(int idx) { - always_memset(fp_template + idx * fp_driver->algorithm_template_size, 0, - fp_driver->algorithm_template_size); + always_memset(fp_template[idx], 0, sizeof(fp_template[0])); always_memset(fp_positive_match_salt[idx], 0, sizeof(fp_positive_match_salt[0])); } @@ -93,10 +91,10 @@ static void _fp_clear_context(void) void fp_reset_and_clear_context(void) { - if (fp_driver->fp_sensor_deinit() != EC_SUCCESS) + if (fp_sensor_deinit() != EC_SUCCESS) CPRINTS("Failed to deinit sensor"); _fp_clear_context(); - if (fp_driver->fp_sensor_init() != EC_SUCCESS) + if (fp_sensor_init() != EC_SUCCESS) CPRINTS("Failed to init sensor"); } |