Lines Matching +full:k +full:- +full:to +full:- +full:j
1 // SPDX-License-Identifier: GPL-2.0-or-later
22 * look_up_OID - Find an OID registration for the specified data
31 unsigned i, j, k, hash; in look_up_OID() local
35 hash = datasize - 1; in look_up_OID()
47 k = OID__NR; in look_up_OID()
48 while (i < k) { in look_up_OID()
49 j = (i + k) / 2; in look_up_OID()
51 xhash = oid_search_table[j].hash; in look_up_OID()
53 k = j; in look_up_OID()
57 i = j + 1; in look_up_OID()
61 oid = oid_search_table[j].oid; in look_up_OID()
62 len = oid_index[oid + 1] - oid_index[oid]; in look_up_OID()
64 k = j; in look_up_OID()
68 i = j + 1; in look_up_OID()
72 /* Variation is most likely to be at the tail end of the in look_up_OID()
76 unsigned char a = oid_data[oid_index[oid] + --len]; in look_up_OID()
79 k = j; in look_up_OID()
83 i = j + 1; in look_up_OID()
97 * parse_OID - Parse an OID from a bytestream
100 * @oid: Pointer to oid to return result
103 * ASN1_OID | length | oid. The length indicator must equal to datasize - 2.
104 * -EBADMSG is returned if the bytestream is too short.
111 if (datasize < 3 || v[0] != ASN1_OID || v[1] != datasize - 2) in parse_OID()
112 return -EBADMSG; in parse_OID()
114 *oid = look_up_OID(data + 2, datasize - 2); in parse_OID()
120 * sprint_oid - Print an Object Identifier into a buffer
121 * @data: The encoded OID to print
123 * @buffer: The buffer to render into
127 * bytes is returned. -EBADMSG is returned if the data could not be interpreted
128 * and -ENOBUFS if the buffer was too small.
144 return -ENOBUFS; in sprint_oid()
146 bufsize -= count; in sprint_oid()
164 return -ENOBUFS; in sprint_oid()
166 bufsize -= count; in sprint_oid()
173 return -EBADMSG; in sprint_oid()