Lines Matching refs:length
74 static unsigned int der_length_size(length) in der_length_size() argument
75 int length; in der_length_size()
77 if (length < (1<<7))
79 else if (length < (1<<8))
85 else if (length < (1<<16))
87 else if (length < (1<<24))
94 static void der_write_length(buf, length) in der_write_length() argument
96 int length;
98 if (length < (1<<7)) {
99 *(*buf)++ = (unsigned char) length;
101 *(*buf)++ = (unsigned char) (der_length_size(length)+127);
103 if (length >= (1<<24))
104 *(*buf)++ = (unsigned char) (length>>24);
105 if (length >= (1<<16))
106 *(*buf)++ = (unsigned char) ((length>>16)&0xff);
108 if (length >= (1<<8))
109 *(*buf)++ = (unsigned char) ((length>>8)&0xff);
110 *(*buf)++ = (unsigned char) (length&0xff);
152 body_size += 4 + (int) mech->length; /* NEED overflow check */
167 (tok_type == -1) ? 2 : (int) (4 + mech->length + body_size));
169 *(*buf)++ = (unsigned char) mech->length;
170 TWRITE_STR(*buf, mech->elements, mech->length);
223 toid.length = *buf++;
225 if ((toksize-=toid.length) < 0)
228 buf+=toid.length;