@@ -36,7 +36,7 @@ module KeyObject = {
3636
3737module PivateKey = {
3838 include KeyObject . Impl ;
39- type kind = [ KeyObject . publicKey ] ;
39+ type kind = [ KeyObject . privateKey ] ;
4040 type t (' a ) = KeyObject.t('a, [ kind]);
4141 [@ bs . module "crypto" ] external make : Buffer . t => t (' a ) = "createPrivateKey" ;
4242 [@ bs . module "crypto" ]
@@ -61,11 +61,10 @@ module PublicKey = {
6161};
6262
6363module Hash = {
64- type kind = [ Stream . transform | ` Hash ] ;
65- type subtype (' w , ' r , ' a ) =
66- Stream.Transform.subtype('w, 'r, [> kind] as 'a);
67- type supertype (' w , ' r , ' a ) = Stream.subtype('w, 'r, [< kind] as 'a);
68- type t = subtype (Buffer . t , Buffer . t , kind );
64+ type kind (' w , ' r ) = [ Stream.transform('w, 'r) | `Hash];
65+ type subtype (' w , ' r , ' a ) = Stream.subtype([> kind('w, 'r)] as 'a);
66+ type supertype (' w , ' r , ' a ) = Stream.subtype([< kind('w, 'r)] as 'a);
67+ type t = Stream . subtype (kind (Buffer . t , Buffer . t ));
6968 module Impl = {
7069 include Stream . Transform . Impl ;
7170 [@ bs . send ] external copy : t => t = "copy" ;
@@ -78,11 +77,10 @@ module Hash = {
7877[@ bs . module "crypto" ] external createHash : string => Hash . t = "createHash" ;
7978
8079module Hmac = {
81- type kind = [ Stream . transform | ` Hmac ] ;
82- type subtype (' w , ' r , ' a ) =
83- Stream.Transform.subtype('w, 'r, [> kind] as 'a);
84- type supertype (' w , ' r , ' a ) = Stream.subtype('w, 'r, [< kind] as 'a);
85- type t = subtype (Buffer . t , Buffer . t , kind );
80+ type kind (' w , ' r ) = [ Stream.transform('w, 'r) | `Hmac];
81+ type subtype (' w , ' r , ' a ) = Stream.subtype([> kind('w, 'r)] as 'a);
82+ type supertype (' w , ' r , ' a ) = Stream.subtype([< kind('w, 'r)] as 'a);
83+ type t = subtype (Buffer . t , Buffer . t , kind (' w , ' r ));
8684 module Impl = {
8785 include Stream . Transform . Impl ;
8886 [@ bs . send ] external digest : t => Buffer . t = "digest" ;
@@ -105,11 +103,10 @@ module Certificate = {
105103};
106104
107105module Cipher = {
108- type kind = [ Stream . transform | ` Cipher ] ;
109- type subtype (' w , ' r , ' a ) =
110- Stream.Transform.subtype('w, 'r, [> kind] as 'a);
111- type supertype (' w , ' r , ' a ) = Stream.subtype('w, 'r, [< kind] as 'a);
112- type t = subtype (Buffer . t , Buffer . t , kind );
106+ type kind (' w , ' r ) = [ Stream.transform('w, 'r) | `Cipher];
107+ type subtype (' w , ' r , ' a ) = Stream.subtype([> kind('w, 'r)] as 'a);
108+ type supertype (' w , ' r , ' a ) = Stream.subtype([< kind('w, 'r)] as 'a);
109+ type t = Stream . subtype (kind (Buffer . t , Buffer . t ));
113110 module Impl = {
114111 include Stream . Transform . Impl ;
115112 [@ bs . send ] external final : (t , string ) => Buffer . t = "final" ;
@@ -150,11 +147,10 @@ module Cipher = {
150147};
151148
152149module Decipher = {
153- type kind = [ Stream . transform | ` Decipher ] ;
154- type subtype (' w , ' r , ' a ) =
155- Stream.Transform.subtype('w, 'r, [> kind] as 'a);
156- type supertype (' w , ' r , ' a ) = Stream.subtype('w, 'r, [< kind] as 'a);
157- type t = subtype (Buffer . t , Buffer . t , kind );
150+ type kind (' w , ' r ) = [ Stream.transform('w, 'r) | `Decipher];
151+ type subtype (' w , ' r , ' a ) = Stream.subtype([> kind('w, 'r)] as 'a);
152+ type supertype (' w , ' r , ' a ) = Stream.subtype([< kind('w, 'r)] as 'a);
153+ type t = Stream . subtype (kind (Buffer . t , Buffer . t ));
158154 module Impl = {
159155 [@ bs . send ]
160156 external final : (subtype (' w , ' r , ' a ), string ) => Buffer . t = "final" ;
@@ -197,7 +193,7 @@ module Decipher = {
197193 ) =>
198194 t =
199195 "createDecipheriv" ;
200- };
196+ } /* } */ /* } */ /* module Verify = */ ;
201197
202198// module DiffieHellman = {
203199
@@ -207,10 +203,4 @@ module Decipher = {
207203
208204// };
209205
210- // module Sign = {
211-
212- // };
213-
214- // module Verify = {
215-
216- // };
206+ // module Sign = {
0 commit comments