`sig
class type transform =
object
method available_output : int
method finish : unit
method flush : unit
method get_byte : int
method get_char : char
method get_string : string
method get_substring : bytes * int * int
method input_block_size : int
method output_block_size : int
method put_byte : int -> unit
method put_char : char -> unit
method put_string : string -> unit
method put_substring : bytes -> int -> int -> unit
method wipe : unit
end
val transform_string : Cryptokit.transform -> string -> string
val transform_channel :
Cryptokit.transform ->
?len:int -> Stdlib.in_channel -> Stdlib.out_channel -> unit
val compose :
Cryptokit.transform -> Cryptokit.transform -> Cryptokit.transform
class type hash =
object
method add_byte : int -> unit
method add_char : char -> unit
method add_string : string -> unit
method add_substring : bytes -> int -> int -> unit
method hash_size : int
method result : string
method wipe : unit
end
val hash_string : Cryptokit.hash -> string -> string
val hash_channel :
Cryptokit.hash -> ?len:int -> Stdlib.in_channel -> string
module Random :
sig
class type rng =
object
method random_bytes : bytes -> int -> int -> unit
method wipe : unit
end
val string : Cryptokit.Random.rng -> int -> string
val secure_rng : Cryptokit.Random.rng
val system_rng : unit -> Cryptokit.Random.rng
val device_rng : string -> Cryptokit.Random.rng
val egd_rng : string -> Cryptokit.Random.rng
val hardware_rng : unit -> Cryptokit.Random.rng
val pseudo_rng : string -> Cryptokit.Random.rng
val pseudo_rng_aes_ctr : string -> Cryptokit.Random.rng
end
module Padding :
sig
class type scheme =
object
method pad : bytes -> int -> unit
method strip : bytes -> int
end
val length : Cryptokit.Padding.scheme
val _8000 : Cryptokit.Padding.scheme
end
module Cipher :
sig
type direction = Encrypt | Decrypt
type chaining_mode =
ECB
| CBC
| CFB of int
| OFB of int
| CTR
| CTR_N of int
val aes :
?mode:Cryptokit.Cipher.chaining_mode ->
?pad:Cryptokit.Padding.scheme ->
?iv:string ->
string -> Cryptokit.Cipher.direction -> Cryptokit.transform
val chacha20 :
?iv:string ->
?ctr:int64 ->
string -> Cryptokit.Cipher.direction -> Cryptokit.transform
val des :
?mode:Cryptokit.Cipher.chaining_mode ->
?pad:Cryptokit.Padding.scheme ->
?iv:string ->
string -> Cryptokit.Cipher.direction -> Cryptokit.transform
val triple_des :
?mode:Cryptokit.Cipher.chaining_mode ->
?pad:Cryptokit.Padding.scheme ->
?iv:string ->
string -> Cryptokit.Cipher.direction -> Cryptokit.transform
val arcfour :
string -> Cryptokit.Cipher.direction -> Cryptokit.transform
val blowfish :
?mode:Cryptokit.Cipher.chaining_mode ->
?pad:Cryptokit.Padding.scheme ->
?iv:string ->
string -> Cryptokit.Cipher.direction -> Cryptokit.transform
end
module Hash :
sig
val sha3 : int -> Cryptokit.hash
val keccak : int -> Cryptokit.hash
val sha2 : int -> Cryptokit.hash
val sha224 : unit -> Cryptokit.hash
val sha256 : unit -> Cryptokit.hash
val sha384 : unit -> Cryptokit.hash
val sha512 : unit -> Cryptokit.hash
val ripemd160 : unit -> Cryptokit.hash
val sha1 : unit -> Cryptokit.hash
val md5 : unit -> Cryptokit.hash
end
module MAC :
sig
val hmac_sha1 : string -> Cryptokit.hash
val hmac_sha256 : string -> Cryptokit.hash
val hmac_sha512 : string -> Cryptokit.hash
val hmac_ripemd160 : string -> Cryptokit.hash
val hmac_md5 : string -> Cryptokit.hash
val aes_cmac : ?iv:string -> string -> Cryptokit.hash
val aes :
?iv:string ->
?pad:Cryptokit.Padding.scheme -> string -> Cryptokit.hash
val des :
?iv:string ->
?pad:Cryptokit.Padding.scheme -> string -> Cryptokit.hash
val triple_des :
?iv:string ->
?pad:Cryptokit.Padding.scheme -> string -> Cryptokit.hash
val des_final_triple_des :
?iv:string ->
?pad:Cryptokit.Padding.scheme -> string -> Cryptokit.hash
end
module RSA :
sig
type key = {
size : int;
n : string;
e : string;
d : string;
p : string;
q : string;
dp : string;
dq : string;
qinv : string;
}
val wipe_key : Cryptokit.RSA.key -> unit
val new_key :
?rng:Cryptokit.Random.rng -> ?e:int -> int -> Cryptokit.RSA.key
val encrypt : Cryptokit.RSA.key -> string -> string
val decrypt : Cryptokit.RSA.key -> string -> string
val decrypt_CRT : Cryptokit.RSA.key -> string -> string
val sign : Cryptokit.RSA.key -> string -> string
val sign_CRT : Cryptokit.RSA.key -> string -> string
val unwrap_signature : Cryptokit.RSA.key -> string -> string
end
module DH :
sig
type parameters = { p : string; g : string; privlen : int; }
val new_parameters :
?rng:Cryptokit.Random.rng ->
?privlen:int -> int -> Cryptokit.DH.parameters
type private_secret
val private_secret :
?rng:Cryptokit.Random.rng ->
Cryptokit.DH.parameters -> Cryptokit.DH.private_secret
val message :
Cryptokit.DH.parameters -> Cryptokit.DH.private_secret -> string
val shared_secret :
Cryptokit.DH.parameters ->
Cryptokit.DH.private_secret -> string -> string
val derive_key : ?diversification:string -> string -> int -> string
end
module Block :
sig
class type block_cipher =
object
method blocksize : int
method transform : bytes -> int -> bytes -> int -> unit
method wipe : unit
end
class cipher : Cryptokit.Block.block_cipher -> transform
class cipher_padded_encrypt :
Cryptokit.Padding.scheme -> Cryptokit.Block.block_cipher -> transform
class cipher_padded_decrypt :
Cryptokit.Padding.scheme -> Cryptokit.Block.block_cipher -> transform
class mac :
?iv:string ->
?pad:Cryptokit.Padding.scheme -> Cryptokit.Block.block_cipher -> hash
class mac_final_triple :
?iv:string ->
?pad:Cryptokit.Padding.scheme ->
Cryptokit.Block.block_cipher ->
Cryptokit.Block.block_cipher -> Cryptokit.Block.block_cipher -> hash
class aes_encrypt : string -> block_cipher
class aes_decrypt : string -> block_cipher
class des_encrypt : string -> block_cipher
class des_decrypt : string -> block_cipher
class triple_des_encrypt : string -> block_cipher
class triple_des_decrypt : string -> block_cipher
class blowfish_encrypt : string -> block_cipher
class blowfish_decrypt : string -> block_cipher
class cbc_encrypt :
?iv:string -> Cryptokit.Block.block_cipher -> block_cipher
class cbc_decrypt :
?iv:string -> Cryptokit.Block.block_cipher -> block_cipher
class cfb_encrypt :
?iv:string -> int -> Cryptokit.Block.block_cipher -> block_cipher
class cfb_decrypt :
?iv:string -> int -> Cryptokit.Block.block_cipher -> block_cipher
class ofb :
?iv:string -> int -> Cryptokit.Block.block_cipher -> block_cipher
class ctr :
?iv:string ->
?inc:int -> Cryptokit.Block.block_cipher -> block_cipher
end
module Stream :
sig
class type stream_cipher =
object
method transform : bytes -> int -> bytes -> int -> int -> unit
method wipe : unit
end
class cipher : Cryptokit.Stream.stream_cipher -> transform
class arcfour : string -> stream_cipher
class chacha20 : ?iv:string -> ?ctr:int64 -> string -> stream_cipher
end
module Base64 :
sig
val encode_multiline : unit -> Cryptokit.transform
val encode_compact : unit -> Cryptokit.transform
val encode_compact_pad : unit -> Cryptokit.transform
val decode : unit -> Cryptokit.transform
end
module Hexa :
sig
val encode : unit -> Cryptokit.transform
val decode : unit -> Cryptokit.transform
end
module Zlib :
sig
val compress : ?level:int -> unit -> Cryptokit.transform
val uncompress : unit -> Cryptokit.transform
end
type error =
Wrong_key_size
| Wrong_IV_size
| Wrong_data_length
| Bad_padding
| Output_buffer_overflow
| Incompatible_block_size
| Number_too_long
| Seed_too_short
| Message_too_long
| Bad_encoding
| Compression_error of string * string
| No_entropy_source
| Entropy_source_closed
| Compression_not_supported
exception Error of Cryptokit.error
val wipe_bytes : bytes -> unit
val wipe_string : string -> unit
val xor_bytes : bytes -> int -> bytes -> int -> int -> unit
val xor_string : string -> int -> bytes -> int -> int -> unit
val mod_power : string -> string -> string -> string
val mod_mult : string -> string -> string -> string
end`