~
This commit is contained in:
parent
c41944a799
commit
a9a2409a12
1 changed files with 36 additions and 26 deletions
|
|
@ -28,26 +28,34 @@ let mk_future_denom denom_secmod_sign_f
|
||||||
} :
|
} :
|
||||||
Secmod_denom.rsa_denom) =
|
Secmod_denom.rsa_denom) =
|
||||||
let denom_pub = mk_denomination_key pub in
|
let denom_pub = mk_denomination_key pub in
|
||||||
let ps =
|
let denom_secmod_sig =
|
||||||
|
let open Binary_formats in
|
||||||
let h_denom_pub =
|
let h_denom_pub =
|
||||||
(* TODO hash *)
|
(* TODO hash *)
|
||||||
let v = pub |> RsaPublicKey.to_string in
|
let v = pub |> Types.RsaPublicKey.to_string in
|
||||||
Binary_formats.DenominationHash.{ v= { v } }
|
DenominationHash.{ v= { v } }
|
||||||
in
|
in
|
||||||
let h_section_name =
|
let h_section_name =
|
||||||
(* TODO hash *)
|
(* TODO hash *)
|
||||||
let v = section_name in
|
let v = section_name in
|
||||||
Binary_formats.HashCode.{ v }
|
HashCode.{ v }
|
||||||
in
|
in
|
||||||
let anchor_time = Binary_formats.TimeAbsoluteNBO.{ v= 0_L } in
|
let anchor_time =
|
||||||
let duration_withdraw = Binary_formats.TimeRelativeNBO.{ v= 0_L } in
|
TimeAbsoluteNBO.{ v= Util.ptime_to_int64_us stamp_start }
|
||||||
Binary_formats.DenominationKeyAnnouncementPS.
|
in
|
||||||
{ h_denom_pub; h_section_name; anchor_time; duration_withdraw }
|
let duration_withdraw =
|
||||||
in
|
let v =
|
||||||
let denom_secmod_sig =
|
Ptime.diff stamp_start stamp_expire_withdraw
|
||||||
ps
|
|> Util.ptime_of_span_exn
|
||||||
|> Bin.to_string Binary_formats.DenominationKeyAnnouncementPS.bin
|
|> Util.ptime_to_int64_us
|
||||||
|> denom_secmod_sign_f
|
in
|
||||||
|
TimeRelativeNBO.{ v }
|
||||||
|
in
|
||||||
|
let ps =
|
||||||
|
DenominationKeyAnnouncementPS.
|
||||||
|
{ h_denom_pub; h_section_name; anchor_time; duration_withdraw }
|
||||||
|
in
|
||||||
|
ps |> Bin.to_string DenominationKeyAnnouncementPS.bin |> denom_secmod_sign_f
|
||||||
in
|
in
|
||||||
FutureDenom.
|
FutureDenom.
|
||||||
{
|
{
|
||||||
|
|
@ -80,22 +88,24 @@ let mk_future_sign_key signkey_secmod_sign_f
|
||||||
let v = EddsaPublicKey.to_string pub in
|
let v = EddsaPublicKey.to_string pub in
|
||||||
Binary_formats.ExchangePublicKeyP.{ v= { v } }
|
Binary_formats.ExchangePublicKeyP.{ v= { v } }
|
||||||
in
|
in
|
||||||
let signing_key_announcement_ps =
|
let signkey_secmod_sig =
|
||||||
let anchor_time =
|
let open Binary_formats in
|
||||||
Binary_formats.TimeAbsoluteNBO.{ v= Util.ptime_to_int64_us stamp_start }
|
let ps =
|
||||||
in
|
let anchor_time =
|
||||||
let duration =
|
TimeAbsoluteNBO.{ v= Util.ptime_to_int64_us stamp_start }
|
||||||
let v =
|
|
||||||
Ptime.diff stamp_start stamp_expire
|
|
||||||
|> Util.ptime_of_span_exn
|
|
||||||
|> Util.ptime_to_int64_us
|
|
||||||
in
|
in
|
||||||
Binary_formats.TimeRelativeNBO.{ v }
|
let duration =
|
||||||
|
let v =
|
||||||
|
Ptime.diff stamp_start stamp_expire
|
||||||
|
|> Util.ptime_of_span_exn
|
||||||
|
|> Util.ptime_to_int64_us
|
||||||
|
in
|
||||||
|
TimeRelativeNBO.{ v }
|
||||||
|
in
|
||||||
|
SigningKeyAnnouncementPS.{ exchange_pub; anchor_time; duration }
|
||||||
in
|
in
|
||||||
Binary_formats.SigningKeyAnnouncementPS.
|
ps |> Bin.to_string SigningKeyAnnouncementPS.bin |> signkey_secmod_sign_f
|
||||||
{ exchange_pub; anchor_time; duration }
|
|
||||||
in
|
in
|
||||||
let signkey_secmod_sig = signkey_secmod_sign_f signing_key_announcement_ps in
|
|
||||||
FutureSignKey.
|
FutureSignKey.
|
||||||
{
|
{
|
||||||
key= pub;
|
key= pub;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue