Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Mimi Zohar wrote: > I'm suggesting making bin2hex() a wrapper for calling hex_byte_pack(). Done. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.h

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Joe Perches wrote: > I think Mimi meant using something like: > > char *bin2hex(char *dst, const void *src, size_t count) > { > const unsigned char *_src = src; > > while (count--) > dst = hex_byte_pack(dst, *_src++); > > return dst; > } Ah, I see - yeah, that'

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread Mimi Zohar
On Fri, 2014-09-12 at 21:30 +0100, David Howells wrote: > Mimi Zohar wrote: > > > How about using hex_byte_pack()? > > It doesn't do a bufferful, only one byte. The following code snippet is pretty common: for (i = 0; i < count; i++) bufptr = hex_byte_pack(bufptr, s[i]); I'm suggesting makin

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread Joe Perches
On Fri, 2014-09-12 at 21:30 +0100, David Howells wrote: > Mimi Zohar wrote: > > How about using hex_byte_pack()? > It doesn't do a bufferful, only one byte. I think Mimi meant using something like: char *bin2hex(char *dst, const void *src, size_t count) { const unsigned char *_src = src;

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread David Howells
Mimi Zohar wrote: > How about using hex_byte_pack()? It doesn't do a bufferful, only one byte. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.htm

Re: [Keyrings] [PATCH 1/9] Provide a binary to hex conversion function

2014-09-12 Thread Mimi Zohar
On Fri, 2014-09-12 at 20:05 +0100, David Howells wrote: > Provide a function to convert a buffer of binary data into an unterminated > ascii hex string representation of that data. > > Signed-off-by: David Howells > --- > > include/linux/kernel.h |1 + > lib/hexdump.c | 18 +