summaryrefslogtreecommitdiffstats
path: root/src/crypto/cipher
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-11-02 14:34:01 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-11-02 14:34:01 +0100
commit20a95ef2731ce21acfe5c1ba97b40001217b0216 (patch)
treea41ed017d615a42771113fc9d7ee3df67652620f /src/crypto/cipher
parent7a3c8bee42879add84a143ff98f28cbd0251dc7b (diff)
downloadfastd-20a95ef2731ce21acfe5c1ba97b40001217b0216.tar
fastd-20a95ef2731ce21acfe5c1ba97b40001217b0216.zip
Convert aes128-gcm into a generic gcm method
Diffstat (limited to 'src/crypto/cipher')
-rw-r--r--src/crypto/cipher/ciphers.c.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/crypto/cipher/ciphers.c.in b/src/crypto/cipher/ciphers.c.in
index 7ae2dea..6ff058f 100644
--- a/src/crypto/cipher/ciphers.c.in
+++ b/src/crypto/cipher/ciphers.c.in
@@ -91,6 +91,17 @@ void fastd_cipher_free(fastd_context_t *ctx) {
free(ctx->cipher_contexts);
}
+bool fastd_cipher_available(const char *name) {
+ size_t i;
+ for (i = 0; i < array_size(ciphers); i++) {
+ if (!strcmp(ciphers[i].name, name)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
const fastd_cipher_t* fastd_cipher_get_by_name(fastd_context_t *ctx, const char *name, fastd_cipher_context_t **cctx) {
size_t i;
for (i = 0; i < array_size(ciphers); i++) {