Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file signer_messages.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.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. *)(* *)(*****************************************************************************)moduletypeAuthenticated_request=sigtypet={pkh:Tezos_crypto.Signature.Public_key_hash.t;data:Bytes.t;signature:Tezos_crypto.Signature.toption;}valto_sign:pkh:Tezos_crypto.Signature.Public_key_hash.t->data:Bytes.t->Bytes.tvalencoding:tData_encoding.tendmoduletypeTag=sigvaltag:intendmoduleMake_authenticated_request(T:Tag):Authenticated_request=structtypet={pkh:Tezos_crypto.Signature.Public_key_hash.t;data:Bytes.t;signature:Tezos_crypto.Signature.toption;}letx04=Bytes.of_string"\x04"letto_sign~pkh~data=lettag=Bytes.make1'0'inTzEndian.set_int8tag0T.tag;Bytes.concatBytes.empty[x04;tag;Tezos_crypto.Signature.Public_key_hash.to_bytespkh;data]letencoding=letopenData_encodinginconv(fun{pkh;data;signature}->(pkh,data,signature))(fun(pkh,data,signature)->{pkh;data;signature})(obj3(req"pkh"Tezos_crypto.Signature.Public_key_hash.encoding)(req"data"bytes)(opt"signature"Tezos_crypto.Signature.encoding))endmoduleSign=structmoduleRequest=Make_authenticated_request(structlettag=1end)moduleResponse=structtypet=Tezos_crypto.Signature.tletencoding=letopenData_encodingindef"signer_messages.sign.response"@@obj1(req"signature"Tezos_crypto.Signature.encoding)endendmoduleDeterministic_nonce=structmoduleRequest=Make_authenticated_request(structlettag=2end)moduleResponse=structtypet=Bytes.tletencoding=letopenData_encodingindef"signer_messages.deterministic_nonce.response"@@obj1(req"deterministic_nonce"bytes)endendmoduleDeterministic_nonce_hash=structmoduleRequest=Make_authenticated_request(structlettag=3end)moduleResponse=structtypet=Bytes.tletencoding=letopenData_encodingindef"signer_messages.deterministic_nonce_hash.response"@@obj1(req"deterministic_nonce_hash"bytes)endendmoduleSupports_deterministic_nonces=structmoduleRequest=structtypet=Tezos_crypto.Signature.Public_key_hash.tletencoding=letopenData_encodingindef"signer_messages.supports_deterministic_nonces.request"@@obj1(req"pkh"Tezos_crypto.Signature.Public_key_hash.encoding)endmoduleResponse=structtypet=boolletencoding=letopenData_encodingindef"signer_messages.supports_deterministic_nonces.response"@@obj1(req"bool"bool)endendmodulePublic_key=structmoduleRequest=structtypet=Tezos_crypto.Signature.Public_key_hash.tletencoding=letopenData_encodingindef"signer_messages.public_key.request"@@obj1(req"pkh"Tezos_crypto.Signature.Public_key_hash.encoding)endmoduleResponse=structtypet=Tezos_crypto.Signature.Public_key.tletencoding=letopenData_encodingindef"signer_messages.public_key.response"@@obj1(req"pubkey"Tezos_crypto.Signature.Public_key.encoding)endendmoduleAuthorized_keys=structmoduleResponse=structtypet=|No_authentication|Authorized_keysofTezos_crypto.Signature.Public_key_hash.tlistletencoding=letopenData_encodinginunion[case(Tag0)~title:"No_authentication"(constant"no_authentication_required")(functionNo_authentication->Some()|_->None)(fun()->No_authentication);case(Tag1)~title:"Authorized_keys"(listTezos_crypto.Signature.Public_key_hash.encoding)(functionAuthorized_keysl->Somel|_->None)(funl->Authorized_keysl);]endendmoduleRequest=structtypet=|SignofSign.Request.t|Public_keyofPublic_key.Request.t|Authorized_keys|Deterministic_nonceofDeterministic_nonce.Request.t|Deterministic_nonce_hashofDeterministic_nonce_hash.Request.t|Supports_deterministic_noncesofSupports_deterministic_nonces.Request.tletencoding=letopenData_encodingindef"signer_messages.request"@@union[case(Tag0)~title:"Sign"(merge_objs(obj1(req"kind"(constant"sign")))Sign.Request.encoding)(functionSignreq->Some((),req)|_->None)(fun((),req)->Signreq);case(Tag1)~title:"Public_key"(merge_objs(obj1(req"kind"(constant"public_key")))Public_key.Request.encoding)(functionPublic_keyreq->Some((),req)|_->None)(fun((),req)->Public_keyreq);case(Tag2)~title:"Authorized_keys"(obj1(req"kind"(constant"authorized_keys")))(functionAuthorized_keys->Some()|_->None)(fun()->Authorized_keys);case(Tag3)~title:"Deterministic_nonce"(merge_objs(obj1(req"kind"(constant"deterministic_nonce")))Deterministic_nonce.Request.encoding)(functionDeterministic_noncereq->Some((),req)|_->None)(fun((),req)->Deterministic_noncereq);case(Tag4)~title:"Deterministic_nonce_hash"(merge_objs(obj1(req"kind"(constant"deterministic_nonce_hash")))Deterministic_nonce_hash.Request.encoding)(function|Deterministic_nonce_hashreq->Some((),req)|_->None)(fun((),req)->Deterministic_nonce_hashreq);case(Tag5)~title:"Supports_deterministic_nonces"(merge_objs(obj1(req"kind"(constant"supports_deterministic_nonces")))Supports_deterministic_nonces.Request.encoding)(function|Supports_deterministic_noncesreq->Some((),req)|_->None)(fun((),req)->Supports_deterministic_noncesreq);]endlet()=letopenData_encoding.RegistrationinregisterRequest.encoding;registerSign.Response.encoding;registerDeterministic_nonce.Response.encoding;registerDeterministic_nonce_hash.Response.encoding;registerSupports_deterministic_nonces.Response.encoding;registerPublic_key.Response.encoding