|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] vtpmmgr: fix 32-bit compilation
On 04/25/2014 03:13 AM, Jan Beulich wrote: On 24.04.14 at 22:39, <dgdegra@xxxxxxxxxxxxx> wrote: [...] And the resulting redundancy doesn't seem desirable either. Perhaps this ought to be initialized as an array of bytes? The proper way to do this would be to store it as a big-endian byte array and then import it to a dynamically allocated MPI object. I was trying to be more efficient and avoid byte order conversions on constants, but it sounds like it would be better to just do it the slow way. This isn't a time- or memory-critical operation so there's not a big reason to try to be efficient.
If P is populated from a byte array, then this value (which does need to be the same size as P) will still need to be created by division. + t_uint Xp[XpElts];Or maybe simply typeof(Pp) here, ... No, the type is dictated by the mpi object, not by Pp. If using typeof, it should be typeof(X.n), although X isn't declared yet so that exact expression isn't valid.
True, but both of those were longer and (at least imo) no more clear. + do_random(Xp + XpElts - 1, sizeof(Xp[0]));Also it looks odd to me that this deals with a different number of trailing bit depending on architecture - is that really correct? Jan This check is probably not needed in practice: it handles the 1 in 2^66 chance that the random number is outside the MODP group by discarding either 1/2^31 or 1/2^63 possibilities (also discarding low exponents). I suppose a comment explaining this would be useful. -- Daniel De Graaf National Security Agency _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |