~ubuntu-branches/ubuntu/vivid/nettle/vivid-proposed

« back to all changes in this revision

Viewing changes to serpent-encrypt.c

  • Committer: Package Import Robot
  • Author(s): Magnus Holmgren
  • Date: 2013-03-24 11:38:21 UTC
  • mfrom: (1.5.2)
  • mto: (8.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20130324113821-47kc1q7ojsxmuevv
Tags: 2.6-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * 
25
25
 * You should have received a copy of the GNU Lesser General Public License
26
26
 * along with the nettle library; see the file COPYING.LIB.  If not, write to
27
 
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
28
 
 * MA 02111-1307, USA.
 
27
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
28
 * MA 02111-1301, USA.
29
29
 */
30
30
 
31
31
/* This file is derived from cipher/serpent.c in Libgcrypt v1.4.6.
411
411
 
412
412
#define LINEAR_TRANSFORMATION64(x0,x1,x2,x3)             \
413
413
  do {                                                   \
414
 
    x0 = ROTL64 (13, x0);                    \
415
 
    x2 = ROTL64 (3, x2);                     \
 
414
    x0 = DROTL32 (13, x0);                    \
 
415
    x2 = DROTL32 (3, x2);                     \
416
416
    x1 = x1 ^ x0 ^ x2;        \
417
 
    x3 = x3 ^ x2 ^ RSHIFT64(3, x0);         \
418
 
    x1 = ROTL64 (1, x1);                     \
419
 
    x3 = ROTL64 (7, x3);                     \
 
417
    x3 = x3 ^ x2 ^ DRSHIFT32(3, x0);        \
 
418
    x1 = DROTL32 (1, x1);                     \
 
419
    x3 = DROTL32 (7, x3);                     \
420
420
    x0 = x0 ^ x1 ^ x3;        \
421
 
    x2 = x2 ^ x3 ^ RSHIFT64(7, x1);         \
422
 
    x0 = ROTL64 (5, x0);                     \
423
 
    x2 = ROTL64 (22, x2);                    \
 
421
    x2 = x2 ^ x3 ^ DRSHIFT32(7, x1);        \
 
422
    x0 = DROTL32 (5, x0);                     \
 
423
    x2 = DROTL32 (22, x2);                    \
424
424
  } while (0)
425
425
 
426
426
#define ROUND64(which, subkey, x0,x1,x2,x3, y0,y1,y2,y3) \