| 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 */
|
|
|