Commit 18eaed2f authored by Niels Möller's avatar Niels Möller

*** empty log message ***

Rev: src/nettle/ChangeLog:1.17
Rev: src/nettle/cbc.c:1.3
parent df4ba6cb
2001-09-09 Niels Mller <nisse@cuckoo.hack.org>
* Makefile.am (libnettleinclude_HEADERS): Added cbc.h. Deleted
des3.h.
(libnettle_a_SOURCES): Added des3.c.
* testsuite/Makefile.am (TS_PROGS): Added des3-test and cbc-test.
* testsuite/cbc-test.m4: New testcase.
* testsuite/des3-test.m4: New testcase.
* cbc.h (CBC_CTX): New macro.
(CBC_ENCRYPT): New macro.
(CBC_DECRYPT): New macro.
* des.c (des_fix_parity): New function.
* des3.c: New file, implementing triple des.
2001-09-06 Niels Mller <nisse@cuckoo.hack.org>
* cbc.c, cbc.h: New files, for general CBC encryption.
......
......@@ -81,13 +81,33 @@ cbc_decrypt(void *ctx, void (*f)(void *ctx,
memcpy(iv, src + length - block_size, block_size);
}
#include "des.h"
#if 0
#include "twofish.h"
#include "aes.h"
static void foo(void)
{
struct des_ctx ctx;
uint8_t iv[DES_BLOCK_SIZE];
uint8_t src[DES_BLOCK_SIZE];
uint8_t dst[DES_BLOCK_SIZE];
struct CBC_CTX(struct twofish_ctx, TWOFISH_BLOCK_SIZE) ctx;
uint8_t src[TWOFISH_BLOCK_SIZE];
uint8_t dst[TWOFISH_BLOCK_SIZE];
CBC_ENCRYPT(&ctx, twofish_encrypt, TWOFISH_BLOCK_SIZE, dst, src);
/* Should result in a warning */
CBC_ENCRYPT(&ctx, aes_encrypt, TWOFISH_BLOCK_SIZE, dst, src);
}
static void foo2(void)
{
struct twofish_ctx ctx;
uint8_t iv[TWOFISH_BLOCK_SIZE];
uint8_t src[TWOFISH_BLOCK_SIZE];
uint8_t dst[TWOFISH_BLOCK_SIZE];
CBC_ENCRYPT(&ctx, des_encrypt, DES_BLOCK_SIZE, iv, DES_BLOCK_SIZE, dst, src);
CBC_ENCRYPT2(&ctx, twofish_encrypt, TWOFISH_BLOCK_SIZE, iv, TWOFISH_BLOCK_SIZE, dst, src);
/* Should result in a warning */
CBC_ENCRYPT2(&ctx, aes_encrypt, TWOFISH_BLOCK_SIZE, iv, TWOFISH_BLOCK_SIZE, dst, src);
}
#endif
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