X-Git-Url: http://git.silcnet.org/gitweb/?p=crypto.git;a=blobdiff_plain;f=lib%2Fsilccrypt%2Fcast.c;fp=lib%2Fsilccrypt%2Fcast.c;h=ac8aa770b50d60daff1474a079c66ee258335102;hp=dbf27e716d94dc6a3a28c7a5f334784c71997965;hb=9f20f0382b6229eca740925a73f96294f6dcedc6;hpb=1b4e874f9401653b659a6adec2d2f046f9331586 diff --git a/lib/silccrypt/cast.c b/lib/silccrypt/cast.c index dbf27e71..ac8aa770 100644 --- a/lib/silccrypt/cast.c +++ b/lib/silccrypt/cast.c @@ -87,11 +87,20 @@ SILC_CIPHER_API_SET_IV(cast_cbc) } -/* Returns the size of the cipher context. */ +/* Initialize */ -SILC_CIPHER_API_CONTEXT_LEN(cast_cbc) +SILC_CIPHER_API_INIT(cast_cbc) { - return sizeof(CastContext); + return silc_calloc(1, sizeof(CastContext)); +} + +/* Uninitialize */ + +SILC_CIPHER_API_UNINIT(cast_cbc) +{ + CastContext *cast = context; + memset(cast, 0, sizeof(*cast)); + silc_free(cast); } /* Encrypts with the cipher in CBC mode. Source and destination buffers