summaryrefslogtreecommitdiff
path: root/set7/task49.c
diff options
context:
space:
mode:
authorBenedict <benedict@0xb8000.de>2017-01-26 12:47:42 +0100
committerBenedict <benedict@0xb8000.de>2017-02-21 13:00:27 +0100
commit18acbfa8d29fd1ca9c90fb252b735b2901bbe7fa (patch)
tree9e994cceb6a3e66eb2e7a11ea79734de0bb02f3f /set7/task49.c
parent96447557db2f8a3c2e5f4c32f0cc9d3fb2d5582f (diff)
set7: task50: completed
Diffstat (limited to 'set7/task49.c')
-rw-r--r--set7/task49.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/set7/task49.c b/set7/task49.c
index 62650ba..932a171 100644
--- a/set7/task49.c
+++ b/set7/task49.c
@@ -3,21 +3,9 @@
#include "../lib/lib3.h"
#include "../lib/lib4.h"
#include "../lib/lib5.h"
-#include <time.h>
-#include <openssl/aes.h>
+#include "../lib/lib7.h"
-int cbc_mac(char *msg, unsigned int msg_len, char *iv, char *key, char *mac)
-{
- int padding_len = 0;
-
- char *msg_padded = __pkcs7_padding(msg, msg_len, 16, &padding_len);
- char *res = malloc(msg_len+padding_len);
- aes_cbc(msg_padded, msg_len+padding_len, res, key, iv, 1);
- char *ciphertext = malloc(msg_len+padding_len);
- memcpy(mac, &res[msg_len+padding_len-16], 16);
-}
-
int cbc_mac_forge_controlled_iv(char *msg_is, char *msg_should, char *iv)
{
// generate iv and mac and concat all