@@ -10,17 +10,20 @@ module KeyObject = {
1010 type privateKey = [ | ` PrivateKey ] ;
1111 type secretKey = [ | ` SecretKey ] ;
1212 [@ bs . send ]
13- external symmetricExport : t (symmetric , [ < publicKey | privateKey ] ) => Buffer . t = "export" ;
13+ external symmetricExport :
14+ t (symmetric , [ < publicKey | privateKey ] ) => Buffer . t =
15+ "export" ;
1416 [@ bs . send ]
15- external asymmetricExport : t (asymmetric , [ < publicKey | privateKey | secretKey ] ) => Buffer . t =
17+ external asymmetricExport :
18+ t (asymmetric , [ < publicKey | privateKey | secretKey ] ) => Buffer . t =
1619 "export" ;
1720 module Symmetric = {
18- type kind = [ | symmetric ] ;
21+ type kind = [ symmetric ] ;
1922 type nonrec t (' a ) = t([ kind], 'a);
2023 module Impl = {};
2124 };
2225 module Asymmetric = {
23- type kind = [ | asymmetric ] ;
26+ type kind = [ asymmetric ] ;
2427 type nonrec t (' a ) = t([ kind], 'a);
2528 module Impl = {};
2629 };
@@ -59,7 +62,8 @@ module PublicKey = {
5962
6063module Hash = {
6164 type kind = [ Stream . transform | ` Hash ] ;
62- type subtype (' w , ' r , ' a ) = Stream.Transform.subtype('w, 'r, [> kind] as 'a);
65+ type subtype (' w , ' r , ' a ) =
66+ Stream.Transform.subtype('w, 'r, [> kind] as 'a);
6367 type supertype (' w , ' r , ' a ) = Stream.subtype('w, 'r, [< kind] as 'a);
6468 type t = subtype (Buffer . t , Buffer . t , kind );
6569 module Impl = {
@@ -75,7 +79,8 @@ module Hash = {
7579
7680module Hmac = {
7781 type kind = [ Stream . transform | ` Hmac ] ;
78- type subtype (' w , ' r , ' a ) = Stream.Transform.subtype('w, 'r, [> kind] as 'a);
82+ type subtype (' w , ' r , ' a ) =
83+ Stream.Transform.subtype('w, 'r, [> kind] as 'a);
7984 type supertype (' w , ' r , ' a ) = Stream.subtype('w, 'r, [< kind] as 'a);
8085 type t = subtype (Buffer . t , Buffer . t , kind );
8186 module Impl = {
@@ -86,18 +91,23 @@ module Hmac = {
8691 include Impl ;
8792};
8893
89- [@ bs . module "crypto" ] external createHmac : (string , ~key : string ) => Hmac . t = "createHmac" ;
94+ [@ bs . module "crypto" ]
95+ external createHmac : (string , ~key : string ) => Hmac . t = "createHmac" ;
9096
9197module Certificate = {
9298 type t ;
93- [@ bs . send ] external exportChallenge : (t , Buffer . t ) => Buffer . t = "exportChallenge" ;
94- [@ bs . send ] external exportPublicKey : (t , Buffer . t ) => Buffer . t = "exportPublicKey" ;
95- [@ bs . send ] external verifyCertificate : (t , Buffer . t ) => bool = "verifyCertificate" ;
99+ [@ bs . send ]
100+ external exportChallenge : (t , Buffer . t ) => Buffer . t = "exportChallenge" ;
101+ [@ bs . send ]
102+ external exportPublicKey : (t , Buffer . t ) => Buffer . t = "exportPublicKey" ;
103+ [@ bs . send ]
104+ external verifyCertificate : (t , Buffer . t ) => bool = "verifyCertificate" ;
96105};
97106
98107module Cipher = {
99108 type kind = [ Stream . transform | ` Cipher ] ;
100- type subtype (' w , ' r , ' a ) = Stream.Transform.subtype('w, 'r, [> kind] as 'a);
109+ type subtype (' w , ' r , ' a ) =
110+ Stream.Transform.subtype('w, 'r, [> kind] as 'a);
101111 type supertype (' w , ' r , ' a ) = Stream.subtype('w, 'r, [< kind] as 'a);
102112 type t = subtype (Buffer . t , Buffer . t , kind );
103113 module Impl = {
@@ -106,7 +116,12 @@ module Cipher = {
106116 [@ bs . send ] external setAAD : (t , Buffer . t ) => t = "setAAD" ;
107117 [@ bs . send ]
108118 external setAADWith :
109- (t , Buffer . t , ~options : Stream . Transform . makeOptions (Buffer . t , Buffer . t )) => t =
119+ (
120+ t ,
121+ Buffer . t ,
122+ ~options : Stream . Transform . makeOptions (Buffer . t , Buffer . t )
123+ ) =>
124+ t =
110125 "setAAD" ;
111126 [@ bs . send ] external getAuthTag : t => Buffer . t = "getAuthTag" ;
112127 [@ bs . send ] external setAutoPadding : (t , bool ) => t = "setAutoPadding" ;
@@ -136,19 +151,31 @@ module Cipher = {
136151
137152module Decipher = {
138153 type kind = [ Stream . transform | ` Decipher ] ;
139- type subtype (' w , ' r , ' a ) = Stream.Transform.subtype('w, 'r, [> kind] as 'a);
154+ type subtype (' w , ' r , ' a ) =
155+ Stream.Transform.subtype('w, 'r, [> kind] as 'a);
140156 type supertype (' w , ' r , ' a ) = Stream.subtype('w, 'r, [< kind] as 'a);
141157 type t = subtype (Buffer . t , Buffer . t , kind );
142158 module Impl = {
143- [@ bs . send ] external final : (subtype (' w , ' r , ' a ), string ) => Buffer . t = "final" ;
144- [@ bs . send ] external setAAD : (subtype (' w , ' r , ' a ), Buffer . t ) => t = "setAAD" ;
159+ [@ bs . send ]
160+ external final : (subtype (' w , ' r , ' a ), string ) => Buffer . t = "final" ;
161+ [@ bs . send ]
162+ external setAAD : (subtype (' w , ' r , ' a ), Buffer . t ) => t = "setAAD" ;
145163 [@ bs . send ]
146164 external setAADWith :
147- (subtype (' w , ' r , ' a ), Buffer . t , ~options : Stream . Transform . makeOptions (Buffer . t , Buffer . t )) => t =
165+ (
166+ subtype (' w , ' r , ' a ),
167+ Buffer . t ,
168+ ~options : Stream . Transform . makeOptions (Buffer . t , Buffer . t )
169+ ) =>
170+ t =
148171 "setAAD" ;
149- [@ bs . send ] external setAuthTag : (subtype (' w , ' r , ' a ), Buffer . t ) => t = "setAuthTag" ;
150- [@ bs . send ] external setAutoPatting : (subtype (' w , ' r , ' a ), bool ) => t = "setAutoPadding" ;
151- [@ bs . send ] external update : (subtype (' w , ' r , ' a ), Buffer . t ) => Buffer . t = "update" ;
172+ [@ bs . send ]
173+ external setAuthTag : (subtype (' w , ' r , ' a ), Buffer . t ) => t = "setAuthTag" ;
174+ [@ bs . send ]
175+ external setAutoPatting : (subtype (' w , ' r , ' a ), bool ) => t =
176+ "setAutoPadding" ;
177+ [@ bs . send ]
178+ external update : (subtype (' w , ' r , ' a ), Buffer . t ) => Buffer . t = "update" ;
152179 };
153180 include Impl ;
154181 [@ bs . module "crypto" ]
0 commit comments