• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/Security-57031.1.35/libsecurity_smime/Security/

Lines Matching refs:cc

72     void *              cc;			/* CSP CONTEXT */
185 SecCmsCipherContextRef cc;
455 cc = (SecCmsCipherContextRef)PORT_ZAlloc(sizeof(SecCmsCipherContext));
456 if (cc == NULL)
459 cc->cc = ciphercc;
460 cc->encrypt = encrypt;
462 cc->block_size =cipher_blocksize;
464 return cc;
489 SecCmsCipherContextRef cc;
542 cc = (SecCmsCipherContextRef)PORT_ZAlloc(sizeof(SecCmsCipherContext));
543 if (cc == NULL) {
549 cc->pad_size = PK11_GetBlockSize(mechanism, param);
551 cc->block_size = PK11_IsHW(slot) ? BLOCK_SIZE : cc->pad_size;
558 PORT_Free (cc);
562 cc->cx = ciphercx;
563 cc->doit = (nss_cms_cipher_function) PK11_CipherOp;
564 cc->destroy = (nss_cms_cipher_destroy) PK11_DestroyContext;
565 cc->encrypt = PR_FALSE;
566 cc->pending_count = 0;
568 return cc;
586 SecCmsCipherContextRef cc;
640 cc = (SecCmsCipherContextRef)PORT_ZAlloc(sizeof(SecCmsCipherContext));
641 if (cc == NULL)
645 cc->pad_size = PK11_GetBlockSize(mechanism,param);
647 cc->block_size = PK11_IsHW(slot) ? BLOCK_SIZE : cc->pad_size;
653 PORT_Free(cc);
654 cc = NULL;
669 PORT_Free(cc);
670 cc = NULL;
675 cc->cx = ciphercx;
676 cc->doit = (nss_cms_cipher_function)PK11_CipherOp;
677 cc->destroy = (nss_cms_cipher_destroy)PK11_DestroyContext;
678 cc->encrypt = PR_TRUE;
679 cc->pending_count = 0;
684 return cc;
689 SecCmsCipherContextDestroy(SecCmsCipherContextRef cc)
691 PORT_Assert(cc != NULL);
692 if (cc == NULL)
695 CSSM_DeleteContext(cc->cc);
697 CCCryptorRelease(cc->cc);
699 PORT_Free(cc);
703 SecCmsCipherContextLength(SecCmsCipherContextRef cc, unsigned int input_len, Boolean final, Boolean encrypt)
708 OSStatus rv = CSSM_QuerySize(cc->cc, cc->encrypt, final ? 1 : 2, dataBlockSize);
717 return ((input_len + cc->block_size - 1) / cc->block_size * cc->block_size) + (final ? cc->block_size : 0);
724 * cc - the cipher context
743 SecCmsCipherContextDecryptLength(SecCmsCipherContextRef cc, unsigned int input_len, Boolean final)
746 return SecCmsCipherContextLength(cc, input_len, final, PR_FALSE);
750 PORT_Assert (! cc->encrypt);
752 block_size = cc->block_size;
770 return cc->pending_count + input_len;
782 blocks = (cc->pending_count + input_len - 1) / block_size;
790 * cc - the cipher context
805 SecCmsCipherContextEncryptLength(SecCmsCipherContextRef cc, unsigned int input_len, Boolean final)
808 return SecCmsCipherContextLength(cc, input_len, final, PR_TRUE);
813 PORT_Assert (cc->encrypt);
815 block_size = cc->block_size;
816 pad_size = cc->pad_size;
833 return cc->pending_count + input_len;
835 blocks = (cc->pending_count + input_len) / pad_size;
844 blocks = (cc->pending_count + input_len) / block_size;
853 SecCmsCipherContextCrypt(SecCmsCipherContextRef cc, unsigned char *output,
868 rv = CSSM_EncryptDataUpdate(cc->cc, &inputBuf, 1, &outputBuf, 1, &bytes_output);
870 rv = CSSM_DecryptDataUpdate(cc->cc, &inputBuf, 1, &outputBuf, 1, &bytes_output);
872 rv = CCCryptorUpdate(cc->cc, input, input_len, output, max_output_len, &bytes_output);
881 rv = CSSM_EncryptDataFinal(cc->cc, &remainderBuf);
883 rv = CSSM_DecryptDataFinal(cc->cc, &remainderBuf);
887 rv = CCCryptorFinal(cc->cc, output+bytes_output, max_output_len-bytes_output, &bytes_output_final);
902 * cc - the cipher context
913 * "cc" is the return value from SecCmsCipherStartDecrypt.
920 * of block boundaries. We save excess bytes between calls in "cc".
930 SecCmsCipherContextDecrypt(SecCmsCipherContextRef cc, unsigned char *output,
936 return SecCmsCipherContextCrypt(cc, output,
946 PORT_Assert (! cc->encrypt);
952 max_needed = SecCmsCipherContextDecryptLength(cc, input_len, final);
963 bsize = cc->block_size;
964 padsize = cc->pad_size;
971 return (* cc->doit) (cc->cx, output, output_len_p, max_output_len,
975 pcount = cc->pending_count;
976 pbuf = cc->pending_buf;
996 cc->pending_count = pcount;
1014 rv = (*cc->doit)(cc->cx, output, &ofraglen, max_output_len,
1065 cc->pending_count = pcount;
1069 rv = (* cc->doit)(cc->cx, output, &ofraglen, max_output_len,
1115 * cc - the cipher context
1126 * "cc" is the return value from SecCmsCipherStartEncrypt.
1133 * of block boundaries. We save excess bytes between calls in "cc".
1148 SecCmsCipherContextEncrypt(SecCmsCipherContextRef cc, unsigned char *output,
1154 return SecCmsCipherContextCrypt(cc, output,
1164 PORT_Assert (cc->encrypt);
1170 max_needed = SecCmsCipherContextEncryptLength (cc, input_len, final);
1177 bsize = cc->block_size;
1178 padsize = cc->pad_size;
1185 return (*cc->doit)(cc->cx, output, output_len_p, max_output_len,
1189 pcount = cc->pending_count;
1190 pbuf = cc->pending_buf;
1208 cc->pending_count = pcount;
1217 rv = (* cc->doit) (cc->cx, output, &ofraglen, max_output_len,
1247 rv = (* cc->doit) (cc->cx, output, &ofraglen, max_output_len,
1273 rv = (* cc->doit) (cc->cx, output, &ofraglen, max_output_len,
1286 cc->pending_count = pcount;