Lines Matching refs:cc
201 ref->offset = ARRAY_ELEMENT(pgp->areas, ref->mem).cc;
229 fixup_partials(pgpv_t *pgp, uint8_t *p, size_t totlen, size_t filesize, size_t *cc)
249 for (*cc = 0 ; *cc < totlen ; newcc += partial, *cc += partial + 1) {
250 if (IS_PARTIAL(p[*cc])) {
251 partial = DECODE_PARTIAL(p[*cc]);
252 memcpy(&mem->mem[newcc], &p[*cc + 1], partial);
254 partial = PKT_LENGTH(p, *cc);
255 *cc += PKT_LENGTH_LENGTH(p, *cc);
256 memcpy(&mem->mem[newcc], &p[*cc], partial);
258 *cc += partial;
346 size_t cc;
348 for (cc = 0, i = 0 ; i < len && cc < size ; i++) {
349 cc += snprintf(&s[cc], size - cc, "%02x", bin[i]);
351 return cc;
380 size_t cc;
383 cc = snprintf(s, size, "%s=", name);
385 cc += snprintf(&s[cc], size - cc, "[%u bits] ", bn->bits);
388 cc += snprintf(&s[cc], size - cc, "%s\n", buf);
390 return cc;
403 size_t cc;
405 cc = 0;
406 buf[cc++] = pubkey->version;
407 cc += fmt_32(&buf[cc], (uint32_t)pubkey->birth);
408 buf[cc++] = pubkey->keyalg;
413 cc += fmt_binary_mpi(&pubkey->bn[RSA_N], &buf[cc], size - cc);
414 cc += fmt_binary_mpi(&pubkey->bn[RSA_E], &buf[cc], size - cc);
417 cc += fmt_binary_mpi(&pubkey->bn[DSA_P], &buf[cc], size - cc);
418 cc += fmt_binary_mpi(&pubkey->bn[DSA_Q], &buf[cc], size - cc);
419 cc += fmt_binary_mpi(&pubkey->bn[DSA_G], &buf[cc], size - cc);
420 cc += fmt_binary_mpi(&pubkey->bn[DSA_Y], &buf[cc], size - cc);
423 cc += fmt_binary_mpi(&pubkey->bn[ELGAMAL_P], &buf[cc], size - cc);
424 cc += fmt_binary_mpi(&pubkey->bn[ELGAMAL_G], &buf[cc], size - cc);
425 cc += fmt_binary_mpi(&pubkey->bn[ELGAMAL_Y], &buf[cc], size - cc);
428 return (unsigned)cc;
436 uint16_t cc;
446 cc = fmt_key_mpis(pubkey, buf, sizeof(buf));
448 fmt_16(len, cc);
450 digest_update(&fphash, buf, cc);
459 cc = fmt_binary_mpi(&pubkey->bn[RSA_N], buf, sizeof(buf));
460 digest_update(&fphash, &buf[2], cc - 2);
461 cc = fmt_binary_mpi(&pubkey->bn[RSA_E], buf, sizeof(buf));
462 digest_update(&fphash, &buf[2], cc - 2);
468 if ((cc = fmt_binary_mpi(&pubkey->bn[RSA_N], buf, sizeof(buf))) >= PGPV_KEYID_LEN) {
469 memcpy(fingerprint->v, &buf[cc - PGPV_KEYID_LEN], PGPV_KEYID_LEN);
484 size_t cc;
486 cc = snprintf(s, size, "%s ", name);
488 cc += snprintf(&s[cc], size - cc, "%02hhx%s",
491 cc += snprintf(&s[cc], size - cc, "\n");
492 return cc;
593 size_t cc;
599 cc = snprintf(s, size, "%s%04d-%02d-%02d", header,
602 cc += snprintf(&s[cc], size - cc, " (%lldy %lldm %lldd %lldh %s)",
609 cc += snprintf(&s[cc], size - cc, "%s", trailer);
610 return cc;
1032 size_t cc;
1035 for (cc = 0 ; cc < pktlen ; cc += subattr.size + lenlen + 1) {
1066 size_t cc;
1068 cc = 0;
1069 switch(litdata->format = p[cc++]) {
1079 litdata->namelen = p[cc++];
1080 litdata->filename = &p[cc];
1081 cc += litdata->namelen;
1082 litdata->secs = get_32(&p[cc]);
1083 cc += 4;
1084 litdata->s.data = &p[cc];
1085 litdata->len = litdata->s.size = size - cc;
1087 litdata->offset = cc;
1103 pkt.tag = mem->mem[mem->cc++];
1105 printf("BAD PACKET - bit 7 not 1, offset %zu!\n", mem->cc - 1);
1111 ispartial = (pkt.newfmt && IS_PARTIAL(mem->mem[mem->cc]));
1112 pkt.s.size = get_pkt_len(pkt.newfmt, &mem->mem[mem->cc], mem->size - mem->cc, isprimary);
1113 lenlen = get_pkt_len_len(pkt.newfmt, &mem->mem[mem->cc], isprimary);
1114 pkt.offset = mem->cc;
1115 mem->cc += lenlen;
1117 pkt.s.data = &mem->mem[mem->cc];
1124 pkt.s.size = fixup_partials(pgp, &mem->mem[mem->cc - lenlen], pkt.s.size, mem->size, &size);
1162 printf("hi, need to implement %d, offset %zu\n", pkt.tag, mem->cc);
1165 mem->cc += size;
1361 size_t cc;
1363 cc = snprintf(s, size, "%s %u/%s ", leader, numkeybits(pubkey), fmtkeyalg(pubkey->keyalg));
1364 cc += fmt_binary(&s[cc], size - cc, pubkey->keyid, PGPV_KEYID_LEN);
1365 cc += fmt_time(&s[cc], size - cc, " ", pubkey->birth, "", 0);
1367 cc += fmt_time(&s[cc], size - cc, " [Expiry ", pubkey->birth + pubkey->expiry, "]", 0);
1369 cc += snprintf(&s[cc], size - cc, "\n");
1370 cc += fmt_fingerprint(&s[cc], size - cc, &pubkey->fingerprint, "fingerprint: ");
1371 return cc;
1395 size_t cc;
1397 cc = fmt_pubkey(s, size, &primary->primary, "signature ");
1398 cc += fmt_userid(&s[cc], size - cc, primary, primary->primary_userid);
1401 cc += fmt_userid(&s[cc], size - cc, primary, i);
1405 cc += fmt_pubkey(&s[cc], size - cc, &ARRAY_ELEMENT(primary->signed_subkeys, i).subkey, "encryption");
1407 cc += snprintf(&s[cc], size - cc, "\n");
1408 return cc;
1523 size_t cc;
1525 cc = SUBKEY_LEN("signature") +
1528 return cc;
1687 size_t cc;
1689 cc = 0;
1691 TIME_SNPRINTF(cc, buf, size, "Signature time (%.24s) was before pubkey creation ", signature->birth);
1692 TIME_SNPRINTF(cc, &buf[cc], size - cc, "(%s)\n", pubkey->birth);
1693 return cc;
1698 TIME_SNPRINTF(cc, buf, size, "Signature expired on %.24s\n", t);
1699 return cc;
1703 TIME_SNPRINTF(cc, buf, size, "Signature not valid before %.24s\n", signature->birth);
1704 return cc;
1715 size_t cc;
1718 cc = 0;
1721 TIME_SNPRINTF(cc, buf, size, "Pubkey expired on %.24s\n", t);
1722 return (int)cc;
1726 TIME_SNPRINTF(cc, buf, size, "Pubkey not valid before %.24s\n", pubkey->birth);
1727 return (int)cc;
2037 for (mem->cc = 0; mem->cc < mem->size ; ) {
2217 size_t cc;
2223 cc = ARRAY_ELEMENT(pgp->primaries, ent).fmtsize;
2224 if ((*ret = calloc(1, cc)) == NULL) {
2227 return fmt_primary(*ret, cc, &ARRAY_ELEMENT(pgp->primaries, ent));