summaryrefslogtreecommitdiff
path: root/include/oox/crypto/AgileEngine.hxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-01-22 22:26:41 +0100
committerTomaž Vajngerl <quikee@gmail.com>2017-01-30 11:25:21 +0000
commit5b30a94842388d136f645ed7d16a6941da86b760 (patch)
tree2c99b5da56310d5ec371397939c06119f934dff2 /include/oox/crypto/AgileEngine.hxx
parent93a49ee2a2d44d10a5d83c7c46c165400d14cbc5 (diff)
oox: clean-up crypto classes, use c++11 features
- remove "using namespace std;" - &vector[0] to vector.data() - use nullptr in OPENSSL Change-Id: Ib4067b0256801f94d448bc8d3faf5a2902d694e5 Reviewed-on: https://gerrit.libreoffice.org/33629 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/oox/crypto/AgileEngine.hxx')
-rw-r--r--include/oox/crypto/AgileEngine.hxx28
1 files changed, 12 insertions, 16 deletions
diff --git a/include/oox/crypto/AgileEngine.hxx b/include/oox/crypto/AgileEngine.hxx
index 57a3084dd526..22233b051011 100644
--- a/include/oox/crypto/AgileEngine.hxx
+++ b/include/oox/crypto/AgileEngine.hxx
@@ -26,25 +26,23 @@ namespace oox {
namespace oox {
namespace core {
-const sal_uInt32 SEGMENT_LENGTH = 4096;
-
struct AgileEncryptionInfo
{
- sal_Int32 spinCount;
- sal_Int32 saltSize;
- sal_Int32 keyBits;
- sal_Int32 hashSize;
- sal_Int32 blockSize;
+ sal_Int32 spinCount;
+ sal_Int32 saltSize;
+ sal_Int32 keyBits;
+ sal_Int32 hashSize;
+ sal_Int32 blockSize;
OUString cipherAlgorithm;
OUString cipherChaining;
OUString hashAlgorithm;
- std::vector<sal_uInt8> keyDataSalt;
- std::vector<sal_uInt8> saltValue;
- std::vector<sal_uInt8> encryptedVerifierHashInput;
- std::vector<sal_uInt8> encryptedVerifierHashValue;
- std::vector<sal_uInt8> encryptedKeyValue;
+ std::vector<sal_uInt8> keyDataSalt;
+ std::vector<sal_uInt8> saltValue;
+ std::vector<sal_uInt8> encryptedVerifierHashInput;
+ std::vector<sal_uInt8> encryptedVerifierHashValue;
+ std::vector<sal_uInt8> encryptedKeyValue;
};
class AgileEngine : public CryptoEngine
@@ -54,8 +52,7 @@ class AgileEngine : public CryptoEngine
void calculateHashFinal(const OUString& rPassword, std::vector<sal_uInt8>& aHashFinal);
void calculateBlock(
- const sal_uInt8* rBlock,
- sal_uInt32 aBlockSize,
+ std::vector<sal_uInt8> const & rBlock,
std::vector<sal_uInt8>& rHashFinal,
std::vector<sal_uInt8>& rInput,
std::vector<sal_uInt8>& rOutput);
@@ -63,8 +60,7 @@ class AgileEngine : public CryptoEngine
static Crypto::CryptoType cryptoType(const AgileEncryptionInfo& rInfo);
public:
- AgileEngine();
- virtual ~AgileEngine() override;
+ AgileEngine() = default;
AgileEncryptionInfo& getInfo() { return mInfo;}