crypto_settings.h 801 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include <stdint.h>
  3. #include "../services/crypto/constants.h"
  4. typedef struct {
  5. /**
  6. * @brief Crypto key slot to be used
  7. */
  8. uint8_t crypto_key_slot;
  9. /**
  10. * @brief Crypto algorithms version to be used
  11. */
  12. uint8_t crypto_version;
  13. /**
  14. * @brief Initialization vector (IV) to be used for encryption\decryption
  15. */
  16. uint8_t iv[CRYPTO_IV_LENGTH];
  17. /**
  18. * @brief Randomly-generated salt
  19. */
  20. uint8_t salt[CRYPTO_SALT_LENGTH];
  21. /**
  22. * @brief Encrypted well-known data
  23. */
  24. uint8_t* crypto_verify_data;
  25. /**
  26. * @brief Encrypted well-known data length
  27. */
  28. size_t crypto_verify_data_length;
  29. /**
  30. * @brief Whether user's PIN is required or not
  31. */
  32. bool pin_required;
  33. } CryptoSettings;