Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: crypto/include/aes_icm.h

Issue 2344973002: Update libsrtp to version 2.0 (Closed)
Patch Set: Add '.' back to include_dirs Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/include/aes_gcm_ossl.h ('k') | crypto/include/aes_icm_ossl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/include/aes_icm.h
diff --git a/srtp/crypto/include/gf2_8.h b/crypto/include/aes_icm.h
similarity index 70%
rename from srtp/crypto/include/gf2_8.h
rename to crypto/include/aes_icm.h
index 098d37c9e25d775df65b8eb0f438492634111ec7..96543b10b9f0665c9dc60b116e682a2a934cea46 100644
--- a/srtp/crypto/include/gf2_8.h
+++ b/crypto/include/aes_icm.h
@@ -1,10 +1,11 @@
/*
- * gf2_8.h
+ * aes_icm.h
*
- * GF(256) implementation
+ * Header for AES Integer Counter Mode.
*
* David A. McGrew
* Cisco Systems, Inc.
+ *
*/
/*
@@ -43,37 +44,20 @@
*
*/
+#ifndef AES_ICM_H
+#define AES_ICM_H
-#ifndef GF2_8_H
-#define GF2_8_H
-
-#include "datatypes.h" /* for uint8_t definition */
-
-typedef uint8_t gf2_8;
-
-#define gf2_8_field_polynomial 0x1B
-
-/*
- * gf2_8_shift(x) returns
- */
-
-/*
- * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x'
- * operation, using the field representation from AES; that is, the
- * next gf2_8 value in the cyclic representation of that field. The
- * value z should be an uint8_t.
- */
-
-#define gf2_8_shift(z) (((z) & 128) ? \
- (((z) << 1) ^ gf2_8_field_polynomial) : ((z) << 1))
-
-gf2_8
-gf2_8_compute_inverse(gf2_8 x);
+#include "aes.h"
+#include "cipher.h"
-void
-test_gf2_8(void);
+typedef struct {
+ v128_t counter; /* holds the counter value */
+ v128_t offset; /* initial offset value */
+ v128_t keystream_buffer; /* buffers bytes of keystream */
+ srtp_aes_expanded_key_t expanded_key; /* the cipher key */
+ int bytes_in_buffer; /* number of unused bytes in buffer */
+ int key_size; /* AES key size + 14 byte SALT */
+} srtp_aes_icm_ctx_t;
-gf2_8
-gf2_8_multiply(gf2_8 x, gf2_8 y);
+#endif /* AES_ICM_H */
-#endif /* GF2_8_H */
« no previous file with comments | « crypto/include/aes_gcm_ossl.h ('k') | crypto/include/aes_icm_ossl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698