projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mp-gcd: Add tests for mp_modinv.
[u/mdw/catacomb]
/
square-mktab.c
diff --git
a/square-mktab.c
b/square-mktab.c
index
5c2610e
..
ba2c539
100644
(file)
--- a/
square-mktab.c
+++ b/
square-mktab.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: square-mktab.c,v 1.
1 2000/07/27 18:10:27
mdw Exp $
+ * $Id: square-mktab.c,v 1.
3 2004/04/08 01:36:15
mdw Exp $
*
* Build precomputed tables for the Square block cipher
*
*
* Build precomputed tables for the Square block cipher
*
@@
-27,14
+27,6
@@
* MA 02111-1307, USA.
*/
* MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: square-mktab.c,v $
- * Revision 1.1 2000/07/27 18:10:27 mdw
- * Build precomuted tables for Square.
- *
- */
-
/*----- Header files ------------------------------------------------------*/
#include <assert.h>
/*----- Header files ------------------------------------------------------*/
#include <assert.h>
@@
-84,9
+76,9
@@
static unsigned mul(unsigned x, unsigned y, unsigned m)
* Build the S-box.
*
* This is built from inversion in the multiplicative group of
* Build the S-box.
*
* This is built from inversion in the multiplicative group of
- * %$\gf{2^8}[x]/(p(x))$%, where %$p(x) = x^8
+ x^4 + x^3 + x + 1$%, followed
- *
by an affine transformation treating inputs as vectors over %$\gf{2}$%.
- * The result is a horrible function.
+ * %$\gf{2^8}[x]/(p(x))$%, where %$p(x) = x^8
+x^7+x^6+x^5+x^4+x^2+1$%,
+ *
followed by an affine transformation treating inputs as vectors over
+ *
%$\gf{2}$%.
The result is a horrible function.
*
* The inversion is done slightly sneakily, by building log and antilog
* tables. Let %$a$% be an element of the finite field. If the inverse of
*
* The inversion is done slightly sneakily, by building log and antilog
* tables. Let %$a$% be an element of the finite field. If the inverse of