Add files via upload

Remove redundant code
This commit is contained in:
samsonjaw
2024-03-18 14:08:14 +08:00
committed by GitHub
parent faaa11b3b5
commit 31e81633b9
2 changed files with 0 additions and 4 deletions

View File

@@ -45,7 +45,6 @@ int main() {//g++ AES.cpp main.cpp -o program
getline(cin, tmp);
for (int i = 0; i < 16; i++) { key[i] = tmp[i]; }
cout << "textLength " << textLength << '\n';
unsigned char *ciphertext = new unsigned char [textLength];
encryptECB(textLength,plaintext, key, ciphertext);

View File

@@ -1,7 +1,6 @@
#include"pkcs7_HPP.hpp"
using namespace std;
void pkcs7_padding(string& str, int BlockSize) {
cout << BlockSize << ' ' << str.size() << '\n';
int PaddingSize = BlockSize - (str.size() % BlockSize);
unsigned char PaddingChar = (unsigned char)PaddingSize;
for (int i = 0; i < PaddingSize; i++) {
@@ -12,9 +11,7 @@ void pkcs7_padding(string& str, int BlockSize) {
}
void pkcs7_unpadding(string& str) {
cout << "ttttt " << (unsigned char)str[str.size() - 1] << '\n';
int PaddingSize = (int)((unsigned char)str[str.size() - 1]);
cout << "paddingsize " << PaddingSize << '\n';
str.resize(str.size() - PaddingSize);
return;
}