+/** @brief Structure of algorithm lookup table */
+struct algorithm {
+ /** @brief DisOrder algorithm name */
+ const char *name;
+
+ /** @brief gcrypt algorithm ID */
+ int id;
+};
+
+/** @brief Algorithm lookup table
+ *
+ * We don't use gcry_md_map_name() since that would import gcrypt's API into
+ * the disorder protocol.
+ */
+static const struct algorithm algorithms[] = {
+ { "SHA1", GCRY_MD_SHA1 },
+ { "sha1", GCRY_MD_SHA1 },
+ { "SHA256", GCRY_MD_SHA256 },
+ { "sha256", GCRY_MD_SHA256 },
+ { "SHA384", GCRY_MD_SHA384 },
+ { "sha384", GCRY_MD_SHA384 },
+ { "SHA512", GCRY_MD_SHA512 },
+ { "sha512", GCRY_MD_SHA512 },
+};