Pārlūkot izejas kodu

adapted to new CryptoBigNumbers.Mod

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8596 8c9fc860-2736-0410-a75d-ab315db34111
eth.guenter 6 gadi atpakaļ
vecāks
revīzija
3bbd624411
3 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 1 1
      source/CryptoPrimes.Mod
  2. 1 1
      source/CryptoRSA.Mod
  3. 1 1
      source/CryptoUtils.Mod

+ 1 - 1
source/CryptoPrimes.Mod

@@ -88,7 +88,7 @@ VAR
 
 	PROCEDURE ProbablePrime( bits: INTEGER ): BigNumber;
 	VAR t: BigNumber;  delta, i: LONGINT; p: BigNumber;
-		mods: ARRAY N OF LONGINT;
+		mods: ARRAY N OF UNSIGNED32;
 	BEGIN
 		LOOP
 			p := B.NewRand( bits, 1, 1 );

+ 1 - 1
source/CryptoRSA.Mod

@@ -85,7 +85,7 @@ VAR
 
 
 	(* converts LONGINT to ARRAY OF CHAR; big endian order *)
-	PROCEDURE l2n( l: LONGINT;  VAR buf: Buffer;  pos: LONGINT );
+	PROCEDURE l2n( l: UNSIGNED32;  VAR buf: Buffer;  pos: LONGINT );
 	VAR i: LONGINT;
 	BEGIN
 		i := pos + 3;

+ 1 - 1
source/CryptoUtils.Mod

@@ -162,7 +162,7 @@ VAR
 
 
 	PROCEDURE PutBigNumber*( VAR buf: ARRAY OF CHAR;  VAR pos: LONGINT;  b: B.BigNumber );
-	VAR i, j, len, x: LONGINT;  tmp: ARRAY 2048 OF CHAR;
+	VAR i, j, len: LONGINT;  x: UNSIGNED32;  tmp: ARRAY 2048 OF CHAR;
 	BEGIN
 		len := 0;
 		FOR i := b.len - 1 TO 0 BY -1 DO