This commit is contained in:
swrup 2025-10-18 01:52:59 +02:00
parent 56b665178a
commit 071f5704fe

View file

@ -217,7 +217,8 @@ module GNUNET_RsaPublicKey = struct
e: Z.t;
}
(* need to strip leading zeros or something? *)
(* todo: need to strip leading zeros or something? *)
(* Z.to_bits is in little endian but we need it in big endian *)
let z_to_bigendian_bits v =
let s = Z.to_bits v in
let len = String.length s in
@ -240,9 +241,8 @@ module GNUNET_RsaPublicKey = struct
{ header; n; e })
|+ field header_bin (fun t -> t.header)
(* TODO
Z.to_bits is in little endian but we need it in big endian *)
(* TODO
here it should not be [cstring] but [bytes t.header.n_len] *)
here it should not be [cstring] but [bytes t.header.n_len]
-> just parse this without Bin *)
|+ field cstring (fun t -> z_to_bigendian_bits t.n)
|+ field cstring (fun t -> z_to_bigendian_bits t.e)
|> sealr