diff options
author | Niels Möller <nisse@lysator.liu.se> | 2001-09-07 19:38:29 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2001-09-07 19:38:29 +0200 |
commit | 97829771e9fa1317b2166f9d7a626212b355e5e0 (patch) | |
tree | 380760696c366b11b70c6f495fd8c6f3ca9da926 /cbc.h | |
parent | 4fc4077870fe97ce762e7d4bcb370d47c6eb7259 (diff) | |
download | nettle-97829771e9fa1317b2166f9d7a626212b355e5e0.tar.gz |
Work-in-progress.
Rev: src/nettle/Makefile.am:1.12
Rev: src/nettle/cbc.c:1.2
Rev: src/nettle/cbc.h:1.2
Diffstat (limited to 'cbc.h')
-rw-r--r-- | cbc.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -28,7 +28,7 @@ #include <inttypes.h> -/* Uses a void * for cipher contexts. It's hard to be type safe. */ +/* Uses a void * for cipher contexts. */ void cbc_encrypt(void *ctx, void (*f)(void *ctx, @@ -46,4 +46,11 @@ cbc_decrypt(void *ctx, void (*f)(void *ctx, unsigned length, uint8_t *dst, const uint8_t *src); +/* Type safer variants */ +#define CBC_ENCRYPT(ctx, f, b, iv, l, dst, src) \ +(0 ? ((f)((ctx),0,NULL,NULL)) \ + : cbc_encrypt((void *)(ctx), \ + ((*)(void *, unsigned, uint8_t *, const uint8_t *)) (f), \ + (b), (iv), (l), (dst), (src))) + #endif /* NETTLE_CBC_H_INCLUDED */ |