From b435c9ec5be2748a7cc2d9897f734c3571fe227f Mon Sep 17 00:00:00 2001 From: Harm Berntsen Date: Sun, 5 Mar 2023 21:36:57 +0100 Subject: [PATCH] Make DES 64-bit compatible --- source/desc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/desc.c b/source/desc.c index 92decc3..ad0c941 100644 --- a/source/desc.c +++ b/source/desc.c @@ -37,6 +37,7 @@ #include "rsaeuro.h" #include "des.h" +#include static UINT2 bytebit[8] = { 0200, 0100, 040, 020, 010, 04, 02, 01 @@ -205,7 +206,7 @@ UINT4 Spbox[8][64] = { #else /* S box tables for assembler desfunc */ -unsigned long Spbox[8][64] = { +uint32_t Spbox[8][64] = { 0x04041000,0x00000000,0x00040000,0x04041010, 0x04040010,0x00041010,0x00000010,0x00040000, 0x00001000,0x04041000,0x04041010,0x00001000, @@ -731,7 +732,7 @@ void desfunc(block,ks) UINT4 *block; /* Data block */ UINT4 *ks; /* Key schedule */ { - unsigned long left,right,work; + uint32_t left,right,work; left = block[0]; right = block[1];