Add _init() and _free() for cipher modules
diff --git a/library/ctr_drbg.c b/library/ctr_drbg.c
index 3db517d..249b840 100644
--- a/library/ctr_drbg.c
+++ b/library/ctr_drbg.c
@@ -66,6 +66,8 @@
memset( ctx, 0, sizeof(ctr_drbg_context) );
memset( key, 0, CTR_DRBG_KEYSIZE );
+ aes_init( &ctx->aes_ctx );
+
ctx->f_entropy = f_entropy;
ctx->p_entropy = p_entropy;
@@ -122,6 +124,7 @@
size_t buf_len, use_len;
memset( buf, 0, CTR_DRBG_MAX_SEED_INPUT + CTR_DRBG_BLOCKSIZE + 16 );
+ aes_init( &aes_ctx );
/*
* Construct IV (16 bytes) and S in buffer
@@ -189,6 +192,8 @@
p += CTR_DRBG_BLOCKSIZE;
}
+ aes_free( &aes_ctx );
+
return( 0 );
}