Lines Matching +full:binary +full:- +full:coded

1 // SPDX-License-Identifier: GPL-2.0-only
20 * hex_to_bin - convert a hex digit to its real value
23 * hex_to_bin() converts one hex digit to its actual value or -1 in case of bad
26 * This function is used to load cryptographic keys, so it is coded in such a
30 * (ch - '9' - 1) is negative if ch <= '9'
31 * ('0' - 1 - ch) is negative if ch >= '0'
35 * shift of a negative value is implementation-defined, so we cast the
36 * value to (unsigned) before the shift --- we have 0xffffff if ch is in
38 * we "and" this value with (ch - '0' + 1) --- we have a value 1 ... 10 if ch is
40 * we add this value to -1 --- we have a value 0 ... 9 if ch is in the range '0'
41 * ... '9', -1 otherwise
49 return -1 + in hex_to_bin()
50 ((ch - '0' + 1) & (unsigned)((ch - '9' - 1) & ('0' - 1 - ch)) >> 8) + in hex_to_bin()
51 ((cu - 'A' + 11) & (unsigned)((cu - 'F' - 1) & ('A' - 1 - cu)) >> 8); in hex_to_bin()
56 * hex2bin - convert an ascii hexadecimal string to its binary representation
57 * @dst: binary result
61 * Return 0 on success, -EINVAL in case of bad input.
65 while (count--) { in hex2bin()
70 return -EINVAL; in hex2bin()
73 return -EINVAL; in hex2bin()
82 * bin2hex - convert binary data to an ascii hexadecimal string
84 * @src: binary data
85 * @count: binary data length
91 while (count--) in bin2hex()
98 * hex_dump_to_buffer - convert a blob of data to "hex ASCII" in memory
112 * The converted output is always NUL-terminated.
115 * hex_dump_to_buffer(frame->data, frame->len, 16, 1,
160 ret = snprintf(linebuf + lx, linebuflen - lx, in hex_dump_to_buffer()
163 if (ret >= linebuflen - lx) in hex_dump_to_buffer()
171 ret = snprintf(linebuf + lx, linebuflen - lx, in hex_dump_to_buffer()
174 if (ret >= linebuflen - lx) in hex_dump_to_buffer()
182 ret = snprintf(linebuf + lx, linebuflen - lx, in hex_dump_to_buffer()
185 if (ret >= linebuflen - lx) in hex_dump_to_buffer()
203 lx--; in hex_dump_to_buffer()
225 return ascii ? ascii_column + len : (groupsize * 2 + 1) * ngroups - 1; in hex_dump_to_buffer()
231 * print_hex_dump - print a text hex dump to syslog for a binary blob of data
254 * 16, 1, frame->data, frame->len, true);
256 * Example output using %DUMP_PREFIX_OFFSET and 1-byte mode:
258 * Example output using %DUMP_PREFIX_ADDRESS and 4-byte mode:
274 remaining -= rowsize; in print_hex_dump()