[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/4] stubdom/grub: send kernel measurements to vTPM



Daniel De Graaf, le Tue 27 Nov 2012 10:14:45 -0500, a écrit :
> +static inline uint16_t be16(uint16_t v)
> +{
> +     return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +     return (be16(v) << 16) | be16(v >> 16);
> +}

Better use the existing bswap_16 and bswap_32.

> +void sha_compute(uint32_t *buf, void *src, uint32_t len);
> +++ b/stubdom/grub/sha1.c

I guess it could find its way in mini-os/lib?

BTW, what is the licence and copyright of this implementation?  We need
to be sure about that.

> @@ -0,0 +1,260 @@
> +/*
> + * SHA1 routine optimized to do word accesses rather than byte accesses,
> + * and to avoid unnecessary copies into the context array.
> + *
> + * This was based on the git SHA1 implementation.
> + */
> +
> +#include <stdint.h>
> +#include <string.h>
> +
> +static inline uint16_t be16(uint16_t v)
> +{
> +     return (v >> 8) | (v << 8);
> +}
> +
> +static inline uint32_t be32(uint32_t v)
> +{
> +     return (be16(v) << 16) | be16(v >> 16);
> +}

Ditto bswap_16/32

Samuel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.