Fix blockwise read/write for end writes near end of device.
[platform/upstream/cryptsetup.git] / lib / libcryptsetup.h
index 443ba9f..13fd178 100644 (file)
@@ -302,6 +302,8 @@ int crypt_memory_lock(struct crypt_device *cd, int lock);
 #define CRYPT_LOOPAES "LOOPAES"
 /** dm-verity mode */
 #define CRYPT_VERITY "VERITY"
+/** TCRYPT mode */
+#define CRYPT_TCRYPT "TCRYPT"
 
 /**
  * Get device type
@@ -380,6 +382,29 @@ struct crypt_params_verity {
        uint32_t flags;            /**< CRYPT_VERITY* flags */
 };
 
+/**
+ *
+ * Structure used as parameter for TCRYPT device type
+ *
+ * @see crypt_format
+ *
+ */
+/** Try to load hidden header (describing hidden device) */
+#define CRYPT_TCRYPT_HIDDEN_HEADER   (1 << 0)
+#define CRYPT_TCRYPT_LEGACY_MODES    (1 << 1)
+
+struct crypt_params_tcrypt {
+       const char *passphrase;
+       size_t passphrase_size;
+       const char **keyfiles;
+       unsigned int keyfiles_count;
+       const char *hash_name;     /**< hash function for PBKDF */
+       const char *cipher;        /**< cipher chain c1[-c2[-c3]] */
+       const char *mode;          /**< cipher block mode */
+       size_t key_size;           /**< key size in bytes (the whole chain) */
+       uint32_t flags;            /**< CRYPT_TCRYPT* flags */
+};
+
 /** @} */
 
 /**