aboutsummaryrefslogtreecommitdiffstats
path: root/common/sexputil.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/sexputil.c')
-rw-r--r--common/sexputil.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/sexputil.c b/common/sexputil.c
index 66cd9f60e..7a67f2b7c 100644
--- a/common/sexputil.c
+++ b/common/sexputil.c
@@ -698,3 +698,19 @@ hash_algo_to_string (int algo)
return hashnames[i].name;
return "?";
}
+
+
+/* Map cipher modes to a string. */
+const char *
+cipher_mode_to_string (int mode)
+{
+ switch (mode)
+ {
+ case GCRY_CIPHER_MODE_CFB: return "CFB";
+ case GCRY_CIPHER_MODE_CBC: return "CBC";
+ case GCRY_CIPHER_MODE_GCM: return "GCM";
+ case GCRY_CIPHER_MODE_OCB: return "OCB";
+ case 14: return "EAX"; /* Only in gcrypt 1.9 */
+ default: return "[?]";
+ }
+}