OLD | NEW |
1 /* | 1 /* |
2 * aes.c | 2 * aes.c |
3 * | 3 * |
4 * An implemnetation of the AES block cipher. | 4 * An implemnetation of the AES block cipher. |
5 * | 5 * |
6 * David A. McGrew | 6 * David A. McGrew |
7 * Cisco Systems, Inc. | 7 * Cisco Systems, Inc. |
8 */ | 8 */ |
9 | 9 |
10 /* | 10 /* |
(...skipping 25 matching lines...) Expand all Loading... |
36 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 36 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
37 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 37 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
38 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 38 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
41 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 41 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
42 * OF THE POSSIBILITY OF SUCH DAMAGE. | 42 * OF THE POSSIBILITY OF SUCH DAMAGE. |
43 * | 43 * |
44 */ | 44 */ |
45 | 45 |
| 46 #ifdef HAVE_CONFIG_H |
| 47 #include <config.h> |
| 48 #endif |
46 | 49 |
47 #include "aes.h" | 50 #include "aes.h" |
48 #include "err.h" | 51 #include "err.h" |
49 | 52 |
50 /* | 53 /* |
51 * we use the tables T0, T1, T2, T3, and T4 to compute AES, and | 54 * we use the tables T0, T1, T2, T3, and T4 to compute AES, and |
52 * the tables U0, U1, U2, and U4 to compute its inverse | 55 * the tables U0, U1, U2, and U4 to compute its inverse |
53 * | 56 * |
54 * different tables are used on little-endian (Intel, VMS) and | 57 * different tables are used on little-endian (Intel, VMS) and |
55 * big-endian processors (everything else) | 58 * big-endian processors (everything else) |
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2056 aes_inv_final_round(plaintext, &exp_key->round[12]); | 2059 aes_inv_final_round(plaintext, &exp_key->round[12]); |
2057 } | 2060 } |
2058 else if (exp_key->num_rounds == 14) { | 2061 else if (exp_key->num_rounds == 14) { |
2059 aes_inv_round(plaintext, &exp_key->round[10]); | 2062 aes_inv_round(plaintext, &exp_key->round[10]); |
2060 aes_inv_round(plaintext, &exp_key->round[11]); | 2063 aes_inv_round(plaintext, &exp_key->round[11]); |
2061 aes_inv_round(plaintext, &exp_key->round[12]); | 2064 aes_inv_round(plaintext, &exp_key->round[12]); |
2062 aes_inv_round(plaintext, &exp_key->round[13]); | 2065 aes_inv_round(plaintext, &exp_key->round[13]); |
2063 aes_inv_final_round(plaintext, &exp_key->round[14]); | 2066 aes_inv_final_round(plaintext, &exp_key->round[14]); |
2064 } | 2067 } |
2065 } | 2068 } |
OLD | NEW |