From b9d9f18874d2cf4de3c9cffeaac716df71a31e99 Mon Sep 17 00:00:00 2001 From: Jan Hutter Date: Mon, 28 Nov 2005 15:20:51 +0000 Subject: - added compution of all needed keys and also creation of needed transform objects --- Source/charon/transforms/crypters/crypter.c | 17 +++++++++++++++++ Source/charon/transforms/crypters/crypter.h | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'Source/charon/transforms') diff --git a/Source/charon/transforms/crypters/crypter.c b/Source/charon/transforms/crypters/crypter.c index 8a9f590d3..1a0f859eb 100644 --- a/Source/charon/transforms/crypters/crypter.c +++ b/Source/charon/transforms/crypters/crypter.c @@ -45,3 +45,20 @@ mapping_t encryption_algorithm_m[] = { {ENCR_AES_CTR, "ENCR_AES_CTR"}, {MAPPING_END, NULL} }; + +/* + * Described in header. + */ +crypter_t *crypter_create(encryption_algorithm_t encryption_algorithm,size_t blocksize) +{ + switch (encryption_algorithm) + { + case ENCR_AES_CBC: + { + return (crypter_t*)aes_cbc_crypter_create(blocksize); + + } + default: + return NULL; + } +} diff --git a/Source/charon/transforms/crypters/crypter.h b/Source/charon/transforms/crypters/crypter.h index 1d2b2b35c..878ea5ef4 100644 --- a/Source/charon/transforms/crypters/crypter.h +++ b/Source/charon/transforms/crypters/crypter.h @@ -118,10 +118,11 @@ struct crypter_t { * @brief Generic constructor for crypter_t objects. * * @param encryption_algorithm Algorithm to use for crypter + * @param blocksize block size in bytes * @return * - crypter_t if successfully * - NULL if out of ressources or crypter not supported */ -crypter_t *crypter_create(encryption_algorithm_t encryption_algorithm); +crypter_t *crypter_create(encryption_algorithm_t encryption_algorithm, size_t blocksize); #endif /*CRYPTER_H_*/ -- cgit v1.2.3