From 3deea9a0e1cb9e88283153f82b1a3be2d4a27d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Fri, 7 Sep 2018 12:02:01 +0200 Subject: [PATCH] slim it! --- twofish/bin.ml | 2 -- twofish/bin.mli | 2 -- twofish/cbc.ml | 3 ++- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/twofish/bin.ml b/twofish/bin.ml index d29c89d..bf89670 100644 --- a/twofish/bin.ml +++ b/twofish/bin.ml @@ -17,8 +17,6 @@ *) -let chr x = char_of_int x - let and32 x n = Int32.logand x n let xor32 x y = Int32.logxor x y let or32 x y = Int32.logor x y diff --git a/twofish/bin.mli b/twofish/bin.mli index 5457af1..edc9e6e 100644 --- a/twofish/bin.mli +++ b/twofish/bin.mli @@ -1,6 +1,4 @@ -val chr : int -> char - val and32 : Int32.t -> Int32.t -> Int32.t val xor32 : Int32.t -> Int32.t -> Int32.t val or32 : Int32.t -> Int32.t -> Int32.t diff --git a/twofish/cbc.ml b/twofish/cbc.ml index 2622824..f592c56 100644 --- a/twofish/cbc.ml +++ b/twofish/cbc.ml @@ -31,7 +31,8 @@ let xor_strings b c = let int c = int_of_char c in String.init (String.length b) (fun i -> - Bin.chr((int b.[i]) lxor (int c.[i]))) + char_of_int @@ + int b.[i] lxor int c.[i]) let encrypt cbc enc p =