• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/Security-57031.1.35/Security/libsecurity_keychain/libDER/libDER/

Lines Matching refs:length

62 	DERByte *buf,		/* encoded length goes here */
92 /* calculate size of encoded length */
94 DERSize length)
98 if(length < 0x80) {
99 /* short form length */
103 /* long form - one length-of-length byte plus length bytes */
105 while(length != 0) {
107 length >>= 8;
112 /* encode length */
114 DERSize length,
115 DERByte *buf, /* encoded length goes here */
119 DERSize outLen = DERLengthOfLength(length);
125 if(length < 0x80) {
127 *buf = (DERByte)length;
133 *buf = (outLen - 1) | 0x80; // length of length, long form indicator
134 lenBytes = buf + outLen - 1; // l.s. digit of length
135 while(length != 0) {
136 *lenBytes-- = (DERByte)length;
137 length >>= 8;
145 DERSize length)
147 return DERLengthOfTag(tag) + DERLengthOfLength(length) + length;
152 DERSize length,
160 DERSize bytesLeft = DERLengthOfItem(tag, length);
175 drtn = DEREncodeLength(length, currPtr, &itemLen);
181 DERMemmove(currPtr, src, length);
188 static /* calculate the content length of an encoded sequence */
199 /* find length of each item */
208 contentLen += itemSrc->length;
212 if ((currOptions & DER_DEC_OPTIONAL) && itemSrc->length == 0) {
219 * length of this item =
221 * length of length +
222 * content length +
228 thisContentLen = itemSrc->length;
230 (itemSrc->length != 0)) {
271 /* content length */
295 DERMemmove(currPtr, itemSrc->data, itemSrc->length);
296 currPtr += itemSrc->length;
297 bytesLeft -= itemSrc->length;
301 if ((currOptions & DER_DEC_OPTIONAL) && itemSrc->length == 0) {
316 contentLen = itemSrc->length;
318 (itemSrc->length != 0)) {
326 /* encode content length */
340 DERMemmove(currPtr, itemSrc->data, itemSrc->length);
341 currPtr += itemSrc->length;
342 bytesLeft -= itemSrc->length;
348 /* calculate the length of an encoded sequence. */