Squashed 'third_party/rawrtc/re/' content from commit f3163ce8b
Change-Id: I6a235e6ac0f03269d951026f9d195da05c40fdab
git-subtree-dir: third_party/rawrtc/re
git-subtree-split: f3163ce8b526a13b35ef71ce4dd6f43585064d8a
diff --git a/include/re_aes.h b/include/re_aes.h
new file mode 100644
index 0000000..4559bad
--- /dev/null
+++ b/include/re_aes.h
@@ -0,0 +1,27 @@
+/**
+ * @file re_aes.h Interface to AES (Advanced Encryption Standard)
+ *
+ * Copyright (C) 2010 Creytiv.com
+ */
+
+
+#ifndef AES_BLOCK_SIZE
+#define AES_BLOCK_SIZE 16
+#endif
+
+/** AES mode */
+enum aes_mode {
+ AES_MODE_CTR, /**< AES Counter mode (CTR) */
+ AES_MODE_GCM, /**< AES Galois Counter Mode (GCM) */
+};
+
+struct aes;
+
+int aes_alloc(struct aes **stp, enum aes_mode mode,
+ const uint8_t *key, size_t key_bits,
+ const uint8_t *iv);
+void aes_set_iv(struct aes *aes, const uint8_t *iv);
+int aes_encr(struct aes *aes, uint8_t *out, const uint8_t *in, size_t len);
+int aes_decr(struct aes *aes, uint8_t *out, const uint8_t *in, size_t len);
+int aes_get_authtag(struct aes *aes, uint8_t *tag, size_t taglen);
+int aes_authenticate(struct aes *aes, const uint8_t *tag, size_t taglen);