]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavutil/aes.h
WMA: extend exponent range to 95
[frescor/ffmpeg.git] / libavutil / aes.h
index 12e15501d36bcd0787c5d33f420feb9711a8883c..1ca853d93073a8420749ead394d2b36dad710c4a 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AES_H
-#define AES_H
+#ifndef AVUTIL_AES_H
+#define AVUTIL_AES_H
+
+#include <stdint.h>
+
+extern const int av_aes_size;
 
 struct AVAES;
 
 /**
- * creates a AVAES context, which can be freed with av_free()
+ * Initializes an AVAES context.
  * @param key_bits 128, 192 or 256
  * @param decrypt 0 for encryption, 1 for decryption
  */
-struct AVAES *av_aes_init(uint8_t *key, int key_bits, int decrypt);
+int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
+
+/**
+ * Encrypts / decrypts.
+ * @param count number of 16 byte blocks
+ * @param dst destination array, can be equal to src
+ * @param src source array, can be equal to dst
+ * @param iv initialization vector for CBC mode, if NULL then ECB will be used
+ * @param decrypt 0 for encryption, 1 for decryption
+ */
+void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
 
-#endif /* AES_H */
+#endif /* AVUTIL_AES_H */