summaryrefslogtreecommitdiff
path: root/include/my_crypt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_crypt.h')
-rw-r--r--include/my_crypt.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/my_crypt.h b/include/my_crypt.h
new file mode 100644
index 00000000000..c6b5e734b5e
--- /dev/null
+++ b/include/my_crypt.h
@@ -0,0 +1,42 @@
+// TODO: Add Windows support
+
+#ifndef MYSYS_MY_CRYPT_H_
+#define MYSYS_MY_CRYPT_H_
+
+#include <my_aes.h>
+
+#if !defined(HAVE_YASSL) && defined(HAVE_OPENSSL)
+
+#define HAVE_EncryptAes128Ctr
+
+C_MODE_START
+Crypt_result my_aes_encrypt_ctr(const uchar* source, uint32 source_length,
+ uchar* dest, uint32* dest_length,
+ const unsigned char* key, uint8 key_length,
+ const unsigned char* iv, uint8 iv_length,
+ uint noPadding);
+
+Crypt_result my_aes_decrypt_ctr(const uchar* source, uint32 source_length,
+ uchar* dest, uint32* dest_length,
+ const unsigned char* key, uint8 key_length,
+ const unsigned char* iv, uint8 iv_length,
+ uint noPadding);
+C_MODE_END
+
+Crypt_result EncryptAes128Ctr(const uchar* key,
+ const uchar* iv, int iv_size,
+ const uchar* plaintext, int plaintext_size,
+ uchar* ciphertext, int* ciphertext_used);
+
+Crypt_result DecryptAes128Ctr(const uchar* key,
+ const uchar* iv, int iv_size,
+ const uchar* ciphertext, int ciphertext_size,
+ uchar* plaintext, int* plaintext_used);
+
+#endif /* !defined(HAVE_YASSL) && defined(HAVE_OPENSSL) */
+
+C_MODE_START
+Crypt_result my_random_bytes(uchar* buf, int num);
+C_MODE_END
+
+#endif /* MYSYS_MY_CRYPT_H_ */