Commit 9f6dfb25 authored by gerd's avatar gerd

int32 experiments


git-svn-id: https://godirepo.camlcity.org/svn/lib-cryptgps/trunk@19 b101cce4-44db-0310-b718-db4b2d8d2e05
parent 151e44ca
...@@ -10,10 +10,14 @@ ...@@ -10,10 +10,14 @@
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# specific rules for this package: # specific rules for this package:
OBJECTS = cryptsystem_64.cmo cryptmodes_64.cmo \ OBJECTS = crypt_aux.cmo \
crypt_blowfish.cmo crypt_des.cmo crypt_3des.cmo cryptsystem_64.cmo cryptmodes_64.cmo \
XOBJECTS = cryptsystem_64.cmx cryptmodes_64.cmx \ crypt_blowfish.cmo crypt_des.cmo crypt_3des.cmo \
crypt_blowfish.cmx crypt_des.cmx crypt_3des.cmx crypt_blowfish32.cmo
XOBJECTS = crypt_aux.cmx \
cryptsystem_64.cmx cryptmodes_64.cmx \
crypt_blowfish.cmx crypt_des.cmx crypt_3des.cmx \
crypt_blowfish32.cmx
ARCHIVE = cryptgps.cma ARCHIVE = cryptgps.cma
XARCHIVE = cryptgps.cmxa XARCHIVE = cryptgps.cmxa
NAME = cryptgps NAME = cryptgps
...@@ -82,7 +86,7 @@ release: distclean ...@@ -82,7 +86,7 @@ release: distclean
$(MAKE) dist $(MAKE) dist
.ml.cmx: .ml.cmx:
$(OCAMLOPT) -inline 10000 -c $< $(OCAMLOPT) -inline 10000 -unsafe -c $<
.ml.cmo: .ml.cmo:
$(OCAMLC) -c $< $(OCAMLC) -c $<
......
(* $Id: crypt_3des.ml,v 1.1 1999/06/18 00:23:58 gerd Exp $ (* $Id: crypt_3des.ml,v 1.2 2001/03/10 16:43:21 gerd Exp $
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* This module is part of the cryptgps package by Gerd Stolpmann. * This module is part of the cryptgps package by Gerd Stolpmann.
*) *)
open Crypt_aux
let check_parity key = let check_parity key =
match String.length key with match String.length key with
8 -> Crypt_des.check_parity key 8 -> Crypt_des.check_parity key
...@@ -50,6 +52,12 @@ module Cryptsystem : Cryptsystem_64.T = ...@@ -50,6 +52,12 @@ module Cryptsystem : Cryptsystem_64.T =
| _ -> failwith "Crypt_3des: invalid key length" | _ -> failwith "Crypt_3des: invalid key length"
let encrypt_ecb_int32 k xl xr ret_xl ret_xr =
let x = quadruple_of_int32 xl xr in
let y = encrypt_ecb k x in
int32_of_quadruple y ret_xl ret_xr
let decrypt_ecb k x = let decrypt_ecb k x =
match k.n_keys with match k.n_keys with
1 -> Crypt_des.Cryptsystem.decrypt_ecb k.k1 x 1 -> Crypt_des.Cryptsystem.decrypt_ecb k.k1 x
...@@ -62,6 +70,12 @@ module Cryptsystem : Cryptsystem_64.T = ...@@ -62,6 +70,12 @@ module Cryptsystem : Cryptsystem_64.T =
| _ -> failwith "Crypt_3des: invalid key length" | _ -> failwith "Crypt_3des: invalid key length"
let decrypt_ecb_int32 k xl xr ret_xl ret_xr =
let x = quadruple_of_int32 xl xr in
let y = decrypt_ecb k x in
int32_of_quadruple y ret_xl ret_xr
let prepare key = let prepare key =
let l_key = String.length key in let l_key = String.length key in
match l_key with match l_key with
...@@ -118,6 +132,9 @@ module Cryptmodes = Cryptmodes_64.Make_modes(Cryptsystem) ...@@ -118,6 +132,9 @@ module Cryptmodes = Cryptmodes_64.Make_modes(Cryptsystem)
* History: * History:
* *
* $Log: crypt_3des.ml,v $ * $Log: crypt_3des.ml,v $
* Revision 1.2 2001/03/10 16:43:21 gerd
* int32 experiments
*
* Revision 1.1 1999/06/18 00:23:58 gerd * Revision 1.1 1999/06/18 00:23:58 gerd
* First release. * First release.
* *
......
(* $Id: crypt_blowfish.ml,v 1.1 1999/06/04 20:42:00 gerd Exp $ (* $Id: crypt_blowfish.ml,v 1.2 2001/03/10 16:43:21 gerd Exp $
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* This module is part of the cryptgps package by Gerd Stolpmann. * This module is part of the cryptgps package by Gerd Stolpmann.
*) *)
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* 32 bits because of Caml limitations. * 32 bits because of Caml limitations.
*) *)
open Crypt_aux
module Cryptsystem : Cryptsystem_64.T = module Cryptsystem : Cryptsystem_64.T =
struct struct
...@@ -85,6 +87,12 @@ module Cryptsystem : Cryptsystem_64.T = ...@@ -85,6 +87,12 @@ module Cryptsystem : Cryptsystem_64.T =
compute_rounds 0 xl_lsb xl_msb xr_lsb xr_msb compute_rounds 0 xl_lsb xl_msb xr_lsb xr_msb
let encrypt_ecb_int32 k xl xr ret_xl ret_xr =
let x = quadruple_of_int32 xl xr in
let y = encrypt_ecb k x in
int32_of_quadruple y ret_xl ret_xr
let decrypt_ecb k x = let decrypt_ecb k x =
(* The 64-bit element (xl', xr') is decrypted using key k with: (* The 64-bit element (xl', xr') is decrypted using key k with:
* - xl_lsb' the LSB of xl' * - xl_lsb' the LSB of xl'
...@@ -101,6 +109,12 @@ module Cryptsystem : Cryptsystem_64.T = ...@@ -101,6 +109,12 @@ module Cryptsystem : Cryptsystem_64.T =
encrypt_ecb k' x encrypt_ecb k' x
let decrypt_ecb_int32 k xl xr ret_xl ret_xr =
let x = quadruple_of_int32 xl xr in
let y = decrypt_ecb k x in
int32_of_quadruple y ret_xl ret_xr
let prepare key = let prepare key =
let l_key = String.length key in let l_key = String.length key in
if l_key = 0 or l_key > 56 then if l_key = 0 or l_key > 56 then
...@@ -753,6 +767,9 @@ module Cryptmodes = Cryptmodes_64.Make_modes(Cryptsystem) ...@@ -753,6 +767,9 @@ module Cryptmodes = Cryptmodes_64.Make_modes(Cryptsystem)
* History: * History:
* *
* $Log: crypt_blowfish.ml,v $ * $Log: crypt_blowfish.ml,v $
* Revision 1.2 2001/03/10 16:43:21 gerd
* int32 experiments
*
* Revision 1.1 1999/06/04 20:42:00 gerd * Revision 1.1 1999/06/04 20:42:00 gerd
* Initial revision. * Initial revision.
* *
......
(* $Id: crypt_des.ml,v 1.9 1999/06/18 00:23:58 gerd Exp $ (* $Id: crypt_des.ml,v 1.10 2001/03/10 16:43:21 gerd Exp $
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* This module is part of the cryptgps package by Gerd Stolpmann. * This module is part of the cryptgps package by Gerd Stolpmann.
*) *)
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
* (int * int), MSB first. * (int * int), MSB first.
*) *)
open Crypt_aux
(******************** key parity ************************) (******************** key parity ************************)
...@@ -645,9 +646,18 @@ module Cryptsystem : Cryptsystem_64.T = ...@@ -645,9 +646,18 @@ module Cryptsystem : Cryptsystem_64.T =
let encrypt_ecb k x = let encrypt_ecb k x =
des k k.k_enc x des k k.k_enc x
let encrypt_ecb_int32 k xl xr ret_xl ret_xr =
let x = quadruple_of_int32 xl xr in
let y = encrypt_ecb k x in
int32_of_quadruple y ret_xl ret_xr
let decrypt_ecb k x = let decrypt_ecb k x =
des k k.k_dec x des k k.k_dec x
let decrypt_ecb_int32 k xl xr ret_xl ret_xr =
let x = quadruple_of_int32 xl xr in
let y = decrypt_ecb k x in
int32_of_quadruple y ret_xl ret_xr
let prepare key = let prepare key =
let l_key = String.length key in let l_key = String.length key in
...@@ -829,6 +839,9 @@ module Cryptmodes = Cryptmodes_64.Make_modes(Cryptsystem) ...@@ -829,6 +839,9 @@ module Cryptmodes = Cryptmodes_64.Make_modes(Cryptsystem)
* history: * history:
* *
* $Log: crypt_des.ml,v $ * $Log: crypt_des.ml,v $
* Revision 1.10 2001/03/10 16:43:21 gerd
* int32 experiments
*
* Revision 1.9 1999/06/18 00:23:58 gerd * Revision 1.9 1999/06/18 00:23:58 gerd
* First release. * First release.
* *
......
(* $Id: cryptmodes_64.ml,v 1.1 1999/06/04 20:42:01 gerd Exp $ (* $Id: cryptmodes_64.ml,v 1.2 2001/03/10 16:43:21 gerd Exp $
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* This module is part of the cryptgps package by Gerd Stolpmann. * This module is part of the cryptgps package by Gerd Stolpmann.
*) *)
open Crypt_aux
module type T = module type T =
sig sig
...@@ -251,10 +253,327 @@ module Make_modes (M : Cryptsystem_64.T) = ...@@ -251,10 +253,327 @@ module Make_modes (M : Cryptsystem_64.T) =
;; ;;
module Make_modes_int32 (M : Cryptsystem_64.T) =
struct
type key = M.key
let encrypt_cbc k iv data =
let l = String.length data in
if l mod 8 <> 0 then failwith "encrypt_cbc";
let n = l / 8 in
let data' = String.create l in
let vl = ref Int32.zero in
let vr = ref Int32.zero in
int32_of_quadruple iv vl vr;
for i = 0 to n-1 do
let j = 8*i in
let x3 = (Char.code(data.[j]) lsl 8) lor (Char.code(data.[j+1])) in
let x2 = (Char.code(data.[j+2]) lsl 8) lor (Char.code(data.[j+3])) in
let x1 = (Char.code(data.[j+4]) lsl 8) lor (Char.code(data.[j+5])) in
let x0 = (Char.code(data.[j+6]) lsl 8) lor (Char.code(data.[j+7])) in
let xl =
Int32.logor
(Int32.shift_left (Int32.of_int x3) 16)
(Int32.of_int x2)
in
let xr =
Int32.logor
(Int32.shift_left (Int32.of_int x1) 16)
(Int32.of_int x0)
in
let yl = Int32.logxor xl !vl in
let yr = Int32.logxor xr !vr in
M.encrypt_ecb_int32 k yl yr vl vr;
let v3' = Int32.to_int (Int32.shift_right_logical !vl 16) in
let v2' = Int32.to_int !vl in
let v1' = Int32.to_int (Int32.shift_right_logical !vr 16) in
let v0' = Int32.to_int !vr in
data'.[j] <- Char.chr((v3' lsr 8) land 0xff);
data'.[j+1] <- Char.chr(v3' land 0xff);
data'.[j+2] <- Char.chr((v2' lsr 8) land 0xff);
data'.[j+3] <- Char.chr(v2' land 0xff);
data'.[j+4] <- Char.chr((v1' lsr 8) land 0xff);
data'.[j+5] <- Char.chr(v1' land 0xff);
data'.[j+6] <- Char.chr((v0' lsr 8) land 0xff);
data'.[j+7] <- Char.chr(v0' land 0xff);
done;
quadruple_of_int32 !vl !vr, data'
let decrypt_cbc k iv data =
let l = String.length data in
if l mod 8 <> 0 then failwith "decrypt_cbc";
let n = l / 8 in
let data' = String.create l in
let vl = ref Int32.zero in
let vr = ref Int32.zero in
int32_of_quadruple iv vl vr;
for i = 0 to n-1 do
let j = 8*i in
let x3 = (Char.code(data.[j]) lsl 8) lor (Char.code(data.[j+1])) in
let x2 = (Char.code(data.[j+2]) lsl 8) lor (Char.code(data.[j+3])) in
let x1 = (Char.code(data.[j+4]) lsl 8) lor (Char.code(data.[j+5])) in
let x0 = (Char.code(data.[j+6]) lsl 8) lor (Char.code(data.[j+7])) in
let xl =
Int32.logor
(Int32.shift_left (Int32.of_int x3) 16)
(Int32.of_int x2)
in
let xr =
Int32.logor
(Int32.shift_left (Int32.of_int x1) 16)
(Int32.of_int x0)
in
let yl = ref Int32.zero in
let yr = ref Int32.zero in
M.decrypt_ecb_int32 k xl xr yl yr;
let zl = Int32.logxor !yl !vl in
let zr = Int32.logxor !yr !vr in
let z3 = Int32.to_int (Int32.shift_right_logical zl 16) in
let z2 = Int32.to_int zl in
let z1 = Int32.to_int (Int32.shift_right_logical zr 16) in
let z0 = Int32.to_int zr in
data'.[j] <- Char.chr((z3 lsr 8) land 0xff);
data'.[j+1] <- Char.chr(z3 land 0xff);
data'.[j+2] <- Char.chr((z2 lsr 8) land 0xff);
data'.[j+3] <- Char.chr(z2 land 0xff);
data'.[j+4] <- Char.chr((z1 lsr 8) land 0xff);
data'.[j+5] <- Char.chr(z1 land 0xff);
data'.[j+6] <- Char.chr((z0 lsr 8) land 0xff);
data'.[j+7] <- Char.chr(z0 land 0xff);
vl := xl;
vr := xr;
done;
quadruple_of_int32 !vl !vr, data'
let encrypt_cfb8 k iv data =
let l = String.length data in
let data' = String.create l in
let sr_l = ref Int32.zero in (* shift register MSB *)
let sr_r = ref Int32.zero in (* shift register LSB *)
int32_of_quadruple iv sr_l sr_r;
let out_l = ref Int32.zero in
let out_r = ref Int32.zero in
for i = 0 to l-1 do
M.encrypt_ecb_int32 k !sr_l !sr_r out_l out_r;
let c = Char.code(data.[i]) lxor
((Int32.to_int
(Int32.shift_right_logical !out_l 24)) land 0xff)
in
data'.[i] <- Char.chr c;
sr_l := Int32.logor
(Int32.shift_left !sr_l 8)
(Int32.shift_right_logical !sr_r 24);
sr_r := Int32.logor
(Int32.shift_left !sr_r 8)
(Int32.of_int c)
done;
quadruple_of_int32 !sr_l !sr_r, data'
let decrypt_cfb8 k iv data =
let l = String.length data in
let data' = String.create l in
let sr_l = ref Int32.zero in (* shift register MSB *)
let sr_r = ref Int32.zero in (* shift register LSB *)
int32_of_quadruple iv sr_l sr_r;
let out_l = ref Int32.zero in
let out_r = ref Int32.zero in
for i = 0 to l-1 do
M.encrypt_ecb_int32 k !sr_l !sr_r out_l out_r; (* sic! *)
let c = Char.code(data.[i]) in
let p = c lxor
((Int32.to_int
(Int32.shift_right_logical !out_l 24)) land 0xff)
in
data'.[i] <- Char.chr p;
sr_l := Int32.logor
(Int32.shift_left !sr_l 8)
(Int32.shift_right_logical !sr_r 24);
sr_r := Int32.logor
(Int32.shift_left !sr_r 8)
(Int32.of_int c)
done;
quadruple_of_int32 !sr_l !sr_r, data'
let mask =
[| Int32.of_string "0x00ffffff";
Int32.of_string "0xff00ffff";
Int32.of_string "0xffff00ff";
Int32.of_string "0xffffff00";
|]
let encrypt_cfb64 k iv j data =
if j < 0 or j > 7 then failwith "encrypt_cfb64";
let l = String.length data in
let data' = String.create l in
let sr_l = ref Int32.zero in (* shift register MSB *)
let sr_r = ref Int32.zero in (* shift register LSB *)
int32_of_quadruple iv sr_l sr_r;
let jc = ref j in
for i = 0 to l-1 do
if !jc = 0 then
M.encrypt_ecb_int32 k !sr_l !sr_r sr_l sr_r;
let jc8 = !jc lsl 3 in
let sr_jc =
if !jc < 4 then
(Int32.to_int
(Int32.shift_right_logical !sr_l (24 - jc8)))
land 0xff
else
(Int32.to_int
(Int32.shift_right_logical !sr_r (56 - jc8)))
land 0xff
in
let c = Char.code(data.[i]) lxor sr_jc in
data'.[i] <- Char.chr c;
( if !jc < 4 then
sr_l :=
Int32.logor
(Int32.logand !sr_l mask.(!jc))
(Int32.shift_left (Int32.of_int c) (24 - jc8))
else
sr_r :=
Int32.logor
(Int32.logand !sr_r mask.(!jc - 4))
(Int32.shift_left (Int32.of_int c) (56 - jc8))
);
jc := (!jc + 1) mod 8;
done;
quadruple_of_int32 !sr_l !sr_r, !jc, data'
let decrypt_cfb64 k iv j data =
if j < 0 or j > 7 then failwith "decrypt_cfb64";
let l = String.length data in
let data' = String.create l in
let sr_l = ref Int32.zero in (* shift register MSB *)
let sr_r = ref Int32.zero in (* shift register LSB *)
int32_of_quadruple iv sr_l sr_r;
let jc = ref j in
for i = 0 to l-1 do
if !jc = 0 then
M.encrypt_ecb_int32 k !sr_l !sr_r sr_l sr_r;
let jc8 = !jc lsl 3 in
let sr_jc =
if !jc < 4 then
(Int32.to_int
(Int32.shift_right_logical !sr_l (24 - jc8)))
land 0xff
else
(Int32.to_int
(Int32.shift_right_logical !sr_r (56 - jc8)))
land 0xff
in
let c = Char.code(data.[i]) in
data'.[i] <- Char.chr (c lxor sr_jc);
( if !jc < 4 then
sr_l :=
Int32.logor
(Int32.logand !sr_l mask.(!jc))
(Int32.shift_left (Int32.of_int c) (24 - jc8))
else
sr_r :=
Int32.logor
(Int32.logand !sr_r mask.(!jc - 4))
(Int32.shift_left (Int32.of_int c) (56 - jc8))
);
jc := (!jc + 1) mod 8;
done;
quadruple_of_int32 !sr_l !sr_r, !jc, data'
let crypt_ofb k iv j data =
if j < 0 or j > 7 then failwith "crypt_ofb";
let l = String.length data in
let data' = String.create l in
let sr_l = ref Int32.zero in (* shift register MSB *)
let sr_r = ref Int32.zero in (* shift register LSB *)
int32_of_quadruple iv sr_l sr_r;
let jc = ref j in
for i = 0 to l-1 do
if !jc = 0 then
if !jc = 0 then
M.encrypt_ecb_int32 k !sr_l !sr_r sr_l sr_r;
let jc8 = !jc lsl 3 in
let sr_jc =
if !jc < 4 then
(Int32.to_int
(Int32.shift_right_logical !sr_l (24 - jc8)))
land 0xff
else
(Int32.to_int
(Int32.shift_right_logical !sr_r (56 - jc8)))
land 0xff
in
let c = Char.code(data.[i]) lxor sr_jc in
data'.[i] <- Char.chr c;
jc := (!jc + 1) mod 8;
done;
quadruple_of_int32 !sr_l !sr_r, !jc, data'
end
;;
(* ====================================================================== (* ======================================================================
* History: * History:
* *
* $Log: cryptmodes_64.ml,v $ * $Log: cryptmodes_64.ml,v $
* Revision 1.2 2001/03/10 16:43:21 gerd
* int32 experiments
*
* Revision 1.1 1999/06/04 20:42:01 gerd * Revision 1.1 1999/06/04 20:42:01 gerd
* Initial revision. * Initial revision.
* *
......
(* $Id: cryptmodes_64.mli,v 1.1 1999/06/04 20:42:01 gerd Exp $ (* $Id: cryptmodes_64.mli,v 1.2 2001/03/10 16:43:21 gerd Exp $
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* This module is part of the cryptgps package by Gerd Stolpmann. * This module is part of the cryptgps package by Gerd Stolpmann.
*) *)
...@@ -192,17 +192,34 @@ module type T = ...@@ -192,17 +192,34 @@ module type T =
;; ;;
(* Derives the other modes from the basic ECB mode. *) (* Derives the other modes from the basic ECB mode:
*
* Make_modes: This version is efficient for cryptsystems based on
* encrypt_ecb
* Make_modes_int32: This version is efficient for cryptsystems based on
* encrypt_ecb_int32
*
* Both functors behave in an equivalent way; the only difference is that
* Make_modes is fast if M.encrypt_ecb is fast, and that Make_modes_int32
* is fast if M.encrypt_ecb_int32 is fast.
*)
module Make_modes (M : Cryptsystem_64.T) : T with type key = M.key module Make_modes (M : Cryptsystem_64.T) : T with type key = M.key
;; ;;
module Make_modes_int32 (M : Cryptsystem_64.T) : T with type key = M.key
;;
(* ====================================================================== (* ======================================================================
* History: * History:
* *
* $Log: cryptmodes_64.mli,v $ * $Log: cryptmodes_64.mli,v $
* Revision 1.2 2001/03/10 16:43:21 gerd
* int32 experiments
*
* Revision 1.1 1999/06/04 20:42:01 gerd * Revision 1.1 1999/06/04 20:42:01 gerd
* Initial revision. * Initial revision.
* *
......
(* $Id: cryptsystem_64.ml,v 1.1 1999/06/04 20:42:01 gerd Exp $ (* $Id: cryptsystem_64.ml,v 1.2 2001/03/10 16:43:21 gerd Exp $
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* This module is part of the cryptgps package by Gerd Stolpmann. * This module is part of the cryptgps package by Gerd Stolpmann.
*) *)
...@@ -17,12 +17,20 @@ module type T = ...@@ -17,12 +17,20 @@ module type T =
* are numbers from 0 to 65535, and given from MSB to LSB. * are numbers from 0 to 65535, and given from MSB to LSB.
*) *)
val encrypt_ecb_int32 :
key -> int32 -> int32 -> int32 ref -> int32 ref -> unit
(* The same as encrypt_ecb, but with an int32 interface *)
val decrypt_ecb : val decrypt_ecb :
key -> (int * int * int * int) -> (int * int * int * int) key -> (int * int * int * int) -> (int * int * int * int)
(* This is the ECB mode of the decryption function. The four ints (* This is the ECB mode of the decryption function. The four ints
* are numbers from 0 to 65535, and given from MSB to LSB. * are numbers from 0 to 65535, and given from MSB to LSB.
*) *)
val decrypt_ecb_int32 :
key -> int32 -> int32 -> int32 ref -> int32 ref -> unit
(* The same as decrypt_ecb, but with an int32 interface *)
val prepare : string -> key val prepare : string -> key
(* Prepares the string representation of a key. *) (* Prepares the string representation of a key. *)
...@@ -42,6 +50,9 @@ module type T = ...@@ -42,6 +50,9 @@ module type T =
* History: * History:
* *
* $Log: cryptsystem_64.ml,v $ * $Log: cryptsystem_64.ml,v $
* Revision 1.2 2001/03/10 16:43:21 gerd
* int32 experiments
*
* Revision 1.1 1999/06/04 20:42:01 gerd * Revision 1.1 1999/06/04 20:42:01 gerd
* Initial revision. * Initial revision.
* *
......
(* $Id: cryptsystem_64.mli,v 1.1 1999/06/04 20:42:01 gerd Exp $ (* $Id: cryptsystem_64.mli,v 1.2 2001/03/10 16:43:21 gerd Exp $
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* This module is part of the cryptgps package by Gerd Stolpmann. * This module is part of the cryptgps package by Gerd Stolpmann.
*) *)
...@@ -44,12 +44,20 @@ module type T = ...@@ -44,12 +44,20 @@ module type T =
* are numbers from 0 to 65535, and given from MSB to LSB. * are numbers from 0 to 65535, and given from MSB to LSB.
*) *)
val encrypt_ecb_int32 :
key -> int32 -> int32 -> int32 ref -> int32 ref -> unit
(* The same as encrypt_ecb, but with an int32 interface *)
val decrypt_ecb : val decrypt_ecb :
key -> (int * int * int * int) -> (int * int * int * int) key -> (int * int * int * int) -> (int * int * int * int)
(* This is the ECB mode of the decryption function. The four ints (* This is the ECB mode of the decryption function. The four ints
* are numbers from 0 to 65535, and given from MSB to LSB. * are numbers from 0 to 65535, and given from MSB to LSB.
*) *)
val decrypt_ecb_int32 :
key -> int32 -> int32 -> int32 ref -> int32 ref -> unit
(* The same as decrypt_ecb, but with an int32 interface *)
val prepare : string -> key val prepare : string -> key
(* Prepares the string representation of a key. *) (* Prepares the string representation of a key. *)
...@@ -69,6 +77,9 @@ module type T = ...@@ -69,6 +77,9 @@ module type T =
* History: * History:
* *
* $Log: cryptsystem_64.mli,v $ * $Log: cryptsystem_64.mli,v $
* Revision 1.2 2001/03/10 16:43:21 gerd
* int32 experiments
*
* Revision 1.1 1999/06/04 20:42:01 gerd * Revision 1.1 1999/06/04 20:42:01 gerd
* Initial revision. * Initial revision.
* *
......