Skip to content

Commit

Permalink
des3key: remove offset (always 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Mar 19, 2024
1 parent f69f867 commit 2e67dec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cipher_block.ml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ module DES = struct
invalid_arg "DES.of_secret: key length %u" (String.length key) ;
let key = Bytes.of_string key in
let keybuf = Bytes.create k_s in
Native.DES.des3key key 0 direction ;
Native.DES.des3key key direction ;
Native.DES.cp3key keybuf ;
Bytes.unsafe_to_string keybuf

Expand Down
2 changes: 1 addition & 1 deletion src/native.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end

module DES = struct
external ddes : string -> int -> bytes -> int -> int -> unit = "mc_des_ddes" [@@noalloc]
external des3key : bytes -> int -> int -> unit = "mc_des_des3key" [@@noalloc]
external des3key : bytes -> int -> unit = "mc_des_des3key" [@@noalloc]
external cp3key : bytes -> unit = "mc_des_cp3key" [@@noalloc]
external use3key : string -> unit = "mc_des_use3key" [@@noalloc]
external k_s : unit -> int = "mc_des_key_size" [@@noalloc]
Expand Down
4 changes: 2 additions & 2 deletions src/native/des_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ mc_des_key_size (__unit ()) {
}

CAMLprim value
mc_des_des3key (value key, value off, value direction) {
mc_des3key (_bp_uint8_off (key, off), Int_val (direction));
mc_des_des3key (value key, value direction) {
mc_des3key (_bp_uint8 (key), Int_val (direction));
return Val_unit;
}

Expand Down

0 comments on commit 2e67dec

Please sign in to comment.