X-Git-Url: http://git.silcnet.org/gitweb/?p=crypto.git;a=blobdiff_plain;f=lib%2Fsilccrypt%2Fblowfish.c;fp=lib%2Fsilccrypt%2Fblowfish.c;h=862f1c2015f0ac980b90998d542bbaf92a1bdf44;hp=067a8fb701fa1364a56c4223c19932442aa9210b;hb=9f20f0382b6229eca740925a73f96294f6dcedc6;hpb=1b4e874f9401653b659a6adec2d2f046f9331586 diff --git a/lib/silccrypt/blowfish.c b/lib/silccrypt/blowfish.c index 067a8fb7..862f1c20 100644 --- a/lib/silccrypt/blowfish.c +++ b/lib/silccrypt/blowfish.c @@ -56,11 +56,20 @@ SILC_CIPHER_API_SET_IV(blowfish_cbc) } -/* Returns the size of the cipher context. */ +/* Initialize */ -SILC_CIPHER_API_CONTEXT_LEN(blowfish_cbc) +SILC_CIPHER_API_INIT(blowfish_cbc) { - return sizeof(BlowfishContext); + return silc_calloc(1, sizeof(BlowfishContext)); +} + +/* Unnitialize */ + +SILC_CIPHER_API_UNINIT(blowfish_cbc) +{ + BlowfishContext *b = context; + memset(b, 0, sizeof(*b)); + silc_free(b); } /* Encrypts with the cipher in CBC mode. Source and destination buffers