diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2009-05-15 01:28:48 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2009-05-15 01:28:48 +0200 |
commit | 1bfb8007c22e14025a7308e371851130df94e93e (patch) | |
tree | 4904faf9d2664abf643e4230db5a8d4047b7660b /src/libcrypto/libserpent/test_main.c | |
parent | c628e3455d486e0ebc1b98e749f9b625a9e65523 (diff) | |
download | strongswan-1bfb8007c22e14025a7308e371851130df94e93e.tar.bz2 strongswan-1bfb8007c22e14025a7308e371851130df94e93e.tar.xz |
got rid of libcrypto
Diffstat (limited to 'src/libcrypto/libserpent/test_main.c')
-rw-r--r-- | src/libcrypto/libserpent/test_main.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/libcrypto/libserpent/test_main.c b/src/libcrypto/libserpent/test_main.c deleted file mode 100644 index 350068e60..000000000 --- a/src/libcrypto/libserpent/test_main.c +++ /dev/null @@ -1,34 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include "serpent_cbc.h" -#define BLOCK_SIZE 16 -#define KEY_SIZE 128 /* bits */ -#define KEY "1234567890123456" -#define STR "hola guaso como estaisss ... 012" -#define STRSZ (sizeof(STR)-1) - -#define BLKLEN BLOCK_SIZE -#define CONTEXT_T serpent_context -static int pretty_print(const unsigned char *buf, int count) { - int i=0; - for (;i<count;i++) printf ("%02hhx ", buf[i]); - putchar('\n'); - return i; -} -//#define SIZE STRSZ/2 -#define SIZE STRSZ -int main() { - int ret; - char buf0[SIZE+1], buf1[SIZE+1]; - char IV[BLOCK_SIZE]; - CONTEXT_T ac; - serpent_set_key(&ac, (void *)KEY, KEY_SIZE); - memset(buf0, 0, sizeof (buf0)); - memset(buf1, 0, sizeof (buf1)); - serpent_cbc_encrypt(&ac, STR, buf0, SIZE, IV, 1); - pretty_print(buf0, SIZE); - printf("size=%d ret=%d\n%s\n", SIZE, ret, buf0); - ret=serpent_cbc_encrypt(&ac, buf0, buf1, SIZE, IV, 0); - printf("size=%d ret=%d\n%s\n", SIZE, ret, buf1); - return 0; -} |