On Mon, Aug 21, 2023 at 10:25:35AM +0100, "Daniel P. Berrangé" <berrange@xxxxxxxxxx> wrote: > On Fri, Aug 18, 2023 at 05:50:02AM -0400, Xiaoyao Li wrote: > > From: Isaku Yamahata <isaku.yamahata@xxxxxxxxx> > > > > Implement property_add_sha384() which converts hex string <-> uint8_t[48] > > It will be used for TDX which uses sha384 for measurement. > > I think it is likely a better idea to use base64 for the encoding > the binary hash - we use base64 for all the sev-guest properties > that were binary data. > > At which points the property set/get logic is much simpler as it > is just needing a call to g_base64_encode / g_base64_decode and > length validation for the decode case. Hex string is poplar to show hash value, isn't it? Anyway it's easy for human operator, shell scripts, libvirt or whatever to convert those representations with utility commands like base64 or xxd, or library call. Either way would work. -- Isaku Yamahata <isaku.yamahata@xxxxxxxxxxxxxxx>