Rename PadPkcs7 --> PadderPkcs7.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#ifndef CHAOS_PADDING_PADPKCS7_HPP
|
#ifndef CHAOS_PADDING_PADDERPKCS7_HPP
|
||||||
#define CHAOS_PADDING_PADPKCS7_HPP
|
#define CHAOS_PADDING_PADDERPKCS7_HPP
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
namespace Chaos::Padding
|
namespace Chaos::Padding
|
||||||
{
|
{
|
||||||
|
|
||||||
class PadPkcs7
|
class PadderPkcs7
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
template<typename OutputIt>
|
template<typename OutputIt>
|
||||||
@@ -34,4 +34,4 @@ public:
|
|||||||
|
|
||||||
} // namespace Chaos::Padding
|
} // namespace Chaos::Padding
|
||||||
|
|
||||||
#endif // CHAOS_PADDING_PADPKCS7_HPP
|
#endif // CHAOS_PADDING_PADDERPKCS7_HPP
|
||||||
@@ -18,7 +18,7 @@ set(ChaosTests_SOURCE Hash/Md4HasherTests.cpp
|
|||||||
Cipher/Arc4GenTests.cpp
|
Cipher/Arc4GenTests.cpp
|
||||||
Cipher/Arc4CryptTests.cpp
|
Cipher/Arc4CryptTests.cpp
|
||||||
Cipher/DesCryptTests.cpp
|
Cipher/DesCryptTests.cpp
|
||||||
Padding/PadPkcs7Tests.cpp
|
Padding/PadderPkcs7Tests.cpp
|
||||||
Service/SeArrayTests.cpp
|
Service/SeArrayTests.cpp
|
||||||
Service/ChaosExceptionTests.cpp)
|
Service/ChaosExceptionTests.cpp)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Padding/PadPkcs7.hpp"
|
#include "Padding/PadderPkcs7.hpp"
|
||||||
#include "Service/ChaosException.hpp"
|
#include "Service/ChaosException.hpp"
|
||||||
|
|
||||||
using namespace Chaos::Padding;
|
using namespace Chaos::Padding;
|
||||||
@@ -14,7 +14,7 @@ TEST(PadPkcs7Tests, PadTest)
|
|||||||
std::array<uint8_t, 1> fact = {};
|
std::array<uint8_t, 1> fact = {};
|
||||||
std::array<uint8_t, 1> expected = { 0x01 };
|
std::array<uint8_t, 1> expected = { 0x01 };
|
||||||
|
|
||||||
PadPkcs7::Pad(fact.begin(), fact.end());
|
PadderPkcs7::Pad(fact.begin(), fact.end());
|
||||||
ASSERT_EQ(expected, fact);
|
ASSERT_EQ(expected, fact);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ TEST(PadPkcs7Tests, PadTest)
|
|||||||
0x07, 0x07
|
0x07, 0x07
|
||||||
};
|
};
|
||||||
|
|
||||||
PadPkcs7::Pad(fact.begin(), fact.end());
|
PadderPkcs7::Pad(fact.begin(), fact.end());
|
||||||
ASSERT_EQ(expected, fact);
|
ASSERT_EQ(expected, fact);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ TEST(PadPkcs7Tests, PadTest)
|
|||||||
0x0a, 0x0a, 0x0a, 0x0a, 0x0a
|
0x0a, 0x0a, 0x0a, 0x0a, 0x0a
|
||||||
};
|
};
|
||||||
|
|
||||||
PadPkcs7::Pad(fact.begin(), fact.end());
|
PadderPkcs7::Pad(fact.begin(), fact.end());
|
||||||
ASSERT_EQ(expected, fact);
|
ASSERT_EQ(expected, fact);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ TEST(PadPkcs7Tests, PadTest)
|
|||||||
{
|
{
|
||||||
std::vector<uint8_t> fact(i, 0x00);
|
std::vector<uint8_t> fact(i, 0x00);
|
||||||
|
|
||||||
PadPkcs7::Pad(fact.begin(), fact.end());
|
PadderPkcs7::Pad(fact.begin(), fact.end());
|
||||||
ASSERT_EQ(std::vector<uint8_t>(i, i), fact);
|
ASSERT_EQ(std::vector<uint8_t>(i, i), fact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,19 +56,19 @@ TEST(PadPkcs7Tests, PadInvalidRangeTest)
|
|||||||
{
|
{
|
||||||
std::array<uint8_t, 256> out = {};
|
std::array<uint8_t, 256> out = {};
|
||||||
|
|
||||||
ASSERT_THROW(PadPkcs7::Pad(out.begin(), out.end()), Chaos::Service::ChaosException);
|
ASSERT_THROW(PadderPkcs7::Pad(out.begin(), out.end()), Chaos::Service::ChaosException);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::array<uint8_t, 500> out = {};
|
std::array<uint8_t, 500> out = {};
|
||||||
|
|
||||||
ASSERT_THROW(PadPkcs7::Pad(out.begin(), out.end()), Chaos::Service::ChaosException);
|
ASSERT_THROW(PadderPkcs7::Pad(out.begin(), out.end()), Chaos::Service::ChaosException);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::array<uint8_t, 50> out = {};
|
std::array<uint8_t, 50> out = {};
|
||||||
|
|
||||||
ASSERT_THROW(PadPkcs7::Pad(out.end(), out.begin()), Chaos::Service::ChaosException);
|
ASSERT_THROW(PadderPkcs7::Pad(out.end(), out.begin()), Chaos::Service::ChaosException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ TEST(PadPkcs7Tests, PadOutIteratorUsageTest)
|
|||||||
0x00, 0x00, 0x00
|
0x00, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
PadPkcs7::Pad(fact.begin() + 3, fact.end() - 3);
|
PadderPkcs7::Pad(fact.begin() + 3, fact.end() - 3);
|
||||||
ASSERT_EQ(expected, fact);
|
ASSERT_EQ(expected, fact);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ TEST(PadPkcs7Tests, PadOutIteratorUsageTest)
|
|||||||
0x00, 0x00, 0x00
|
0x00, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
PadPkcs7::Pad(fact.begin() + 3, fact.end() - 3);
|
PadderPkcs7::Pad(fact.begin() + 3, fact.end() - 3);
|
||||||
ASSERT_EQ(expected, fact);
|
ASSERT_EQ(expected, fact);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ TEST(PadPkcs7Tests, PadOutIteratorUsageTest)
|
|||||||
0xbb, 0xbb, 0xbb, 0xbb, 0xbb
|
0xbb, 0xbb, 0xbb, 0xbb, 0xbb
|
||||||
};
|
};
|
||||||
|
|
||||||
PadPkcs7::Pad(fact.begin() + 5, fact.begin() + 5);
|
PadderPkcs7::Pad(fact.begin() + 5, fact.begin() + 5);
|
||||||
ASSERT_EQ(expected, fact);
|
ASSERT_EQ(expected, fact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user