package octez-libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file rustzcash_sig.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
(*****************************************************************************)
(*                                                                           *)
(* Open Source License                                                       *)
(* Copyright (c) 2019-2020 Nomadic Labs <contact@nomadic-labs.com>           *)
(*                                                                           *)
(* Permission is hereby granted, free of charge, to any person obtaining a   *)
(* copy of this software and associated documentation files (the "Software"),*)
(* to deal in the Software without restriction, including without limitation *)
(* the rights to use, copy, modify, merge, publish, distribute, sublicense,  *)
(* and/or sell copies of the Software, and to permit persons to whom the     *)
(* Software is furnished to do so, subject to the following conditions:      *)
(*                                                                           *)
(* The above copyright notice and this permission notice shall be included   *)
(* in all copies or substantial portions of the Software.                    *)
(*                                                                           *)
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  *)
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL   *)
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING   *)
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER       *)
(* DEALINGS IN THE SOFTWARE.                                                 *)
(*                                                                           *)
(*****************************************************************************)

(* Signature that hides the Bytes.t implementation *)
module type T = sig
  type ask (* 32 bytes *)

  type ak (* 32 *)

  type nsk (* 32 *)

  type nk (* 32 *)

  type ovk (* 32 *)

  type diversifier (* 11 *)

  type pkd (* 32 *)

  type nullifier (* 32 *)

  type commitment (* 32 *)

  type epk (* 32 *)

  type symkey (* 32 *)

  type sighash (* 32 *)

  type spend_sig (* 64 *)

  type hash (* 32 *)

  type cv (* 32 *)

  type rk (* 32 *)

  type spend_proof (* 48 + 48 + 96 *)

  type binding_sig (* 64 *)

  type output_proof (* 48 + 48 + 96 *)

  type ivk (* 32 *)

  type ar (* 32 *)

  type rcm (* 32 *)

  type esk (* 32 *)

  type diversifier_index (* 11 *)

  val compare_diversifier_index : diversifier_index -> diversifier_index -> int

  (*96 bytes*)
  type expanded_spending_key = {ask : ask; nsk : nsk; ovk : ovk}

  (* 169 bytes *)
  (* this is an extended_spending_key that can be used to derive more
       keys using zip32*)
  type zip32_expanded_spending_key = {
    depth : Bytes.t;
    (*  1 byte  *)
    parent_fvk_tag : Bytes.t;
    (*  4 bytes *)
    child_index : Bytes.t;
    (*  4 bytes *)
    chain_code : Bytes.t;
    (* 32 bytes *)
    expsk : expanded_spending_key;
    (* 96 bytes *)
    dk : Bytes.t; (* 32 bytes *)
  }

  (* 96 bytes*)
  type full_viewing_key = {ak : ak; nk : nk; ovk : ovk}

  (* 169 bytes *)
  (* this is an extended_full_viewing_key that can be used to derive more
     keys using zip32 *)
  type zip32_full_viewing_key = {
    depth : Bytes.t;
    (*  1 byte  *)
    parent_fvk_tag : Bytes.t;
    (*  4 bytes *)
    child_index : Bytes.t;
    (*  4 bytes *)
    chain_code : Bytes.t;
    (* 32 bytes *)
    fvk : full_viewing_key;
    (* 96 bytes *)
    dk : Bytes.t; (* 32 bytes *)
  }

  val to_nk : Bytes.t -> nk

  val to_ak : Bytes.t -> ak

  val to_ask : Bytes.t -> ask

  val to_nsk : Bytes.t -> nsk

  val to_pkd : Bytes.t -> pkd

  val to_ovk : Bytes.t -> ovk

  val to_nullifier : Bytes.t -> nullifier

  val to_commitment : Bytes.t -> commitment

  val to_symkey : Bytes.t -> symkey

  val to_epk : Bytes.t -> epk

  val to_spend_sig : Bytes.t -> spend_sig

  val to_hash : Bytes.t -> hash

  val to_cv : Bytes.t -> cv

  val to_rk : Bytes.t -> rk

  val to_spend_proof : Bytes.t -> spend_proof

  val to_output_proof : Bytes.t -> output_proof

  val to_sighash : Bytes.t -> sighash

  val to_binding_sig : Bytes.t -> binding_sig

  val to_diversifier : Bytes.t -> diversifier option

  val to_diversifier_index : Bytes.t -> diversifier_index

  val to_ar : Bytes.t -> ar

  val to_rcm : Bytes.t -> rcm

  val to_esk : Bytes.t -> esk

  val to_ivk : Bytes.t -> ivk

  val to_expanded_spending_key : Bytes.t -> expanded_spending_key

  val to_zip32_expanded_spending_key : Bytes.t -> zip32_expanded_spending_key

  val to_full_viewing_key : Bytes.t -> full_viewing_key

  val to_zip32_full_viewing_key : Bytes.t -> zip32_full_viewing_key

  val of_nk : nk -> Bytes.t

  val of_ak : ak -> Bytes.t

  val of_ask : ask -> Bytes.t

  val of_nsk : nsk -> Bytes.t

  val of_pkd : pkd -> Bytes.t

  val of_ovk : ovk -> Bytes.t

  val of_nullifier : nullifier -> Bytes.t

  val of_commitment : commitment -> Bytes.t

  val of_symkey : symkey -> Bytes.t

  val of_epk : epk -> Bytes.t

  val of_spend_sig : spend_sig -> Bytes.t

  val of_hash : hash -> Bytes.t

  val of_cv : cv -> Bytes.t

  val of_rk : rk -> Bytes.t

  val of_spend_proof : spend_proof -> Bytes.t

  val of_output_proof : output_proof -> Bytes.t

  val of_sighash : sighash -> Bytes.t

  val of_binding_sig : binding_sig -> Bytes.t

  val of_diversifier : diversifier -> Bytes.t

  val of_diversifier_index : diversifier_index -> Bytes.t

  val of_ar : ar -> Bytes.t

  val of_rcm : rcm -> Bytes.t

  val of_esk : esk -> Bytes.t

  val of_ivk : ivk -> Bytes.t

  val of_expanded_spending_key : expanded_spending_key -> Bytes.t

  val of_zip32_expanded_spending_key : zip32_expanded_spending_key -> Bytes.t

  val of_full_viewing_key : full_viewing_key -> Bytes.t

  val of_zip32_full_viewing_key : zip32_full_viewing_key -> Bytes.t

  val hash_compare : hash -> hash -> int

  val hash_of_commitment : commitment -> hash

  val commitment_of_hash : hash -> commitment
end
OCaml

Innovation. Community. Security.