summaryrefslogtreecommitdiff
path: root/libfscrypt/include/fscrypt/fscrypt.h
diff options
context:
space:
mode:
Diffstat (limited to 'libfscrypt/include/fscrypt/fscrypt.h')
-rw-r--r--libfscrypt/include/fscrypt/fscrypt.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libfscrypt/include/fscrypt/fscrypt.h b/libfscrypt/include/fscrypt/fscrypt.h
index c780c7ce..78b12560 100644
--- a/libfscrypt/include/fscrypt/fscrypt.h
+++ b/libfscrypt/include/fscrypt/fscrypt.h
@@ -61,6 +61,24 @@ bool ParseOptionsForApiLevel(unsigned int first_api_level, const std::string& op
bool EnsurePolicy(const EncryptionPolicy& policy, const std::string& directory);
+inline bool operator==(const EncryptionOptions& lhs, const EncryptionOptions& rhs) {
+ return (lhs.version == rhs.version) && (lhs.contents_mode == rhs.contents_mode) &&
+ (lhs.filenames_mode == rhs.filenames_mode) && (lhs.flags == rhs.flags) &&
+ (lhs.use_hw_wrapped_key == rhs.use_hw_wrapped_key);
+}
+
+inline bool operator!=(const EncryptionOptions& lhs, const EncryptionOptions& rhs) {
+ return !(lhs == rhs);
+}
+
+inline bool operator==(const EncryptionPolicy& lhs, const EncryptionPolicy& rhs) {
+ return lhs.key_raw_ref == rhs.key_raw_ref && lhs.options == rhs.options;
+}
+
+inline bool operator!=(const EncryptionPolicy& lhs, const EncryptionPolicy& rhs) {
+ return !(lhs == rhs);
+}
+
} // namespace fscrypt
} // namespace android