From 4059c6a9c9d8fcd3a17cc7c7fa2a66e0b459dc17 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 10 Nov 2015 19:10:19 -0800 Subject: [PATCH] DerivedKeyConfig is comparable --- crypto/kdf/DerivedKeyConfig.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crypto/kdf/DerivedKeyConfig.h b/crypto/kdf/DerivedKeyConfig.h index 5e71aa8a..10c3a39b 100644 --- a/crypto/kdf/DerivedKeyConfig.h +++ b/crypto/kdf/DerivedKeyConfig.h @@ -60,6 +60,14 @@ namespace cpputils { uint32_t _p; }; + inline bool operator==(const DerivedKeyConfig &lhs, const DerivedKeyConfig &rhs) { + return lhs.salt() == rhs.salt() && lhs.N() == rhs.N() && lhs.r() == rhs.r() && lhs.p() == rhs.p(); + } + + inline bool operator!=(const DerivedKeyConfig &lhs, const DerivedKeyConfig &rhs) { + return !operator==(lhs, rhs); + } + } #endif