aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block/block_cipher.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-06-16 15:35:51 -0400
committerJack Lloyd <[email protected]>2017-06-16 17:07:36 -0400
commit46e34bf0513129b76481477c4d07452cb48b3cd9 (patch)
treed233736ee6cf901d70ba2e377279654695c1fa32 /src/lib/block/block_cipher.cpp
parent37dac0dc7e1f28e30d25c544cc16dcf49575a0b4 (diff)
Add SM4 block cipher
This work was sponsored by Ribose Inc
Diffstat (limited to 'src/lib/block/block_cipher.cpp')
-rw-r--r--src/lib/block/block_cipher.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/block/block_cipher.cpp b/src/lib/block/block_cipher.cpp
index fa0ecad52..b56f1c571 100644
--- a/src/lib/block/block_cipher.cpp
+++ b/src/lib/block/block_cipher.cpp
@@ -66,6 +66,10 @@
#include <botan/serpent.h>
#endif
+#if defined(BOTAN_HAS_SM4)
+ #include <botan/sm4.h>
+#endif
+
#if defined(BOTAN_HAS_TWOFISH)
#include <botan/twofish.h>
#endif
@@ -233,6 +237,13 @@ BlockCipher::create(const std::string& algo,
}
#endif
+#if defined(BOTAN_HAS_SM4)
+ if(algo == "SM4")
+ {
+ return std::unique_ptr<BlockCipher>(new SM4);
+ }
+#endif
+
#if defined(BOTAN_HAS_XTEA)
if(algo == "XTEA")
{