Commit 8f79db34 authored by Marek Kasik's avatar Marek Kasik
Browse files

DecryptStream: Use Ref instead of two integers

Follow the changes introduced before also in this new code.
parent b1502076
Pipeline #58088 passed with stage
in 7 minutes and 29 seconds
...@@ -130,8 +130,8 @@ void aesEncryptArray(const unsigned char *IV, ...@@ -130,8 +130,8 @@ void aesEncryptArray(const unsigned char *IV,
//------------------------------------------------------------------------ //------------------------------------------------------------------------
EncryptStream::EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, EncryptStream::EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen): int keyLength, Ref refA):
BaseCryptStream(strA, fileKey, algoA, keyLength, objNum, objGen) BaseCryptStream(strA, fileKey, algoA, keyLength, refA)
{ {
// Fill the CBC initialization vector for AES and AES-256 // Fill the CBC initialization vector for AES and AES-256
switch (algo) { switch (algo) {
...@@ -222,8 +222,8 @@ int EncryptStream::lookChar() { ...@@ -222,8 +222,8 @@ int EncryptStream::lookChar() {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
DecryptStream::DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, DecryptStream::DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen): int keyLength, Ref refA):
BaseCryptStream(strA, fileKey, algoA, keyLength, objNum, objGen) BaseCryptStream(strA, fileKey, algoA, keyLength, refA)
{ {
} }
......
...@@ -101,7 +101,7 @@ class EncryptStream : public BaseCryptStream { ...@@ -101,7 +101,7 @@ class EncryptStream : public BaseCryptStream {
public: public:
EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen); int keyLength, Ref ref);
~EncryptStream(); ~EncryptStream();
void reset() override; void reset() override;
int lookChar() override; int lookChar() override;
...@@ -119,7 +119,7 @@ class DecryptStream : public BaseCryptStream { ...@@ -119,7 +119,7 @@ class DecryptStream : public BaseCryptStream {
public: public:
DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen); int keyLength, Ref ref);
~DecryptStream(); ~DecryptStream();
void reset() override; void reset() override;
int lookChar() override; int lookChar() override;
......
...@@ -107,8 +107,8 @@ void aesEncryptArray(const unsigned char *IV, ...@@ -107,8 +107,8 @@ void aesEncryptArray(const unsigned char *IV,
//------------------------------------------------------------------------ //------------------------------------------------------------------------
EncryptStream::EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, EncryptStream::EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen): int keyLength, Ref refA):
BaseCryptStream(strA, fileKey, algoA, keyLength, objNum, objGen) BaseCryptStream(strA, fileKey, algoA, keyLength, refA)
{ {
// Fill the CBC initialization vector for AES and AES-256 // Fill the CBC initialization vector for AES and AES-256
if (algo == cryptAES || algo == cryptAES256) if (algo == cryptAES || algo == cryptAES256)
...@@ -207,8 +207,8 @@ int EncryptStream::lookChar() { ...@@ -207,8 +207,8 @@ int EncryptStream::lookChar() {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
DecryptStream::DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, DecryptStream::DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen): int keyLength, Ref refA):
BaseCryptStream(strA, fileKey, algoA, keyLength, objNum, objGen) BaseCryptStream(strA, fileKey, algoA, keyLength, refA)
{ {
switch (algo) { switch (algo) {
case cryptRC4: case cryptRC4:
......
...@@ -95,7 +95,7 @@ class EncryptStream : public BaseCryptStream { ...@@ -95,7 +95,7 @@ class EncryptStream : public BaseCryptStream {
public: public:
EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen); int keyLength, Ref ref);
~EncryptStream(); ~EncryptStream();
void reset() override; void reset() override;
int lookChar() override; int lookChar() override;
...@@ -112,7 +112,7 @@ class DecryptStream : public BaseCryptStream { ...@@ -112,7 +112,7 @@ class DecryptStream : public BaseCryptStream {
public: public:
DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA, DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen); int keyLength, Ref ref);
~DecryptStream(); ~DecryptStream();
void reset() override; void reset() override;
int lookChar() override; int lookChar() override;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment