insert_byte
insert_byte(buf, 0);
insert_byte(buf, 0);
insert_byte(buf, len & 0x7F);
insert_byte(buf, len_copy & 0xFF);
insert_byte(buf, 0x80 | ((buf->count - oldcount) & 0x7F));
insert_byte(buf, t->asn1class | t->construction | t->tagnum);
insert_byte(buf, tag_copy & 0x7F);
insert_byte(buf, 0x80 | (tag_copy & 0x7F));
insert_byte(buf, t->asn1class | t->construction | 0x1F);
insert_byte(buf, val ? 0xFF : 0x00);
insert_byte(buf, digit);
insert_byte(buf, 0);
insert_byte(buf, 0xFF);
insert_byte(buf, digit);