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

Lines Matching refs:cc

64     CSSM_CC_HANDLE	cc;			/* CSP CONTEXT */
162 SecCmsCipherContextRef cc;
381 cc = (SecCmsCipherContextRef)PORT_ZAlloc(sizeof(SecCmsCipherContext));
382 if (cc == NULL)
385 cc->cc = ciphercc;
386 cc->encrypt = encrypt;
388 return cc;
409 SecCmsCipherContextRef cc;
462 cc = (SecCmsCipherContextRef)PORT_ZAlloc(sizeof(SecCmsCipherContext));
463 if (cc == NULL) {
469 cc->pad_size = PK11_GetBlockSize(mechanism, param);
471 cc->block_size = PK11_IsHW(slot) ? BLOCK_SIZE : cc->pad_size;
478 PORT_Free (cc);
482 cc->cx = ciphercx;
483 cc->doit = (nss_cms_cipher_function) PK11_CipherOp;
484 cc->destroy = (nss_cms_cipher_destroy) PK11_DestroyContext;
485 cc->encrypt = PR_FALSE;
486 cc->pending_count = 0;
488 return cc;
506 SecCmsCipherContextRef cc;
560 cc = (SecCmsCipherContextRef)PORT_ZAlloc(sizeof(SecCmsCipherContext));
561 if (cc == NULL)
565 cc->pad_size = PK11_GetBlockSize(mechanism,param);
567 cc->block_size = PK11_IsHW(slot) ? BLOCK_SIZE : cc->pad_size;
573 PORT_Free(cc);
574 cc = NULL;
589 PORT_Free(cc);
590 cc = NULL;
595 cc->cx = ciphercx;
596 cc->doit = (nss_cms_cipher_function)PK11_CipherOp;
597 cc->destroy = (nss_cms_cipher_destroy)PK11_DestroyContext;
598 cc->encrypt = PR_TRUE;
599 cc->pending_count = 0;
604 return cc;
609 SecCmsCipherContextDestroy(SecCmsCipherContextRef cc)
611 PORT_Assert(cc != NULL);
612 if (cc == NULL)
614 CSSM_DeleteContext(cc->cc);
615 PORT_Free(cc);
619 SecCmsCipherContextLength(SecCmsCipherContextRef cc, unsigned int input_len, Boolean final, Boolean encrypt)
623 OSStatus rv = CSSM_QuerySize(cc->cc, cc->encrypt, final ? 1 : 2, dataBlockSize);
636 * cc - the cipher context
655 SecCmsCipherContextDecryptLength(SecCmsCipherContextRef cc, size_t input_len, Boolean final)
658 return SecCmsCipherContextLength(cc, (unsigned int)input_len, final, PR_FALSE);
662 PORT_Assert (! cc->encrypt);
664 block_size = cc->block_size;
682 return cc->pending_count + input_len;
694 blocks = (cc->pending_count + input_len - 1) / block_size;
702 * cc - the cipher context
717 SecCmsCipherContextEncryptLength(SecCmsCipherContextRef cc, size_t input_len, Boolean final)
720 return SecCmsCipherContextLength(cc, (unsigned int)input_len, final, PR_TRUE);
725 PORT_Assert (cc->encrypt);
727 block_size = cc->block_size;
728 pad_size = cc->pad_size;
745 return cc->pending_count + input_len;
747 blocks = (cc->pending_count + input_len) / pad_size;
756 blocks = (cc->pending_count + input_len) / block_size;
765 SecCmsCipherContextCrypt(SecCmsCipherContextRef cc, unsigned char *output,
779 rv = CSSM_EncryptDataUpdate(cc->cc, &inputBuf, 1, &outputBuf, 1, &bytes_output);
781 rv = CSSM_DecryptDataUpdate(cc->cc, &inputBuf, 1, &outputBuf, 1, &bytes_output);
788 rv = CSSM_EncryptDataFinal(cc->cc, &remainderBuf);
790 rv = CSSM_DecryptDataFinal(cc->cc, &remainderBuf);
806 * cc - the cipher context
817 * "cc" is the return value from SecCmsCipherStartDecrypt.
824 * of block boundaries. We save excess bytes between calls in "cc".
834 SecCmsCipherContextDecrypt(SecCmsCipherContextRef cc, unsigned char *output,
840 return SecCmsCipherContextCrypt(cc, output,
850 PORT_Assert (! cc->encrypt);
856 max_needed = SecCmsCipherContextDecryptLength(cc, input_len, final);
867 bsize = cc->block_size;
868 padsize = cc->pad_size;
875 return (* cc->doit) (cc->cx, output, output_len_p, max_output_len,
879 pcount = cc->pending_count;
880 pbuf = cc->pending_buf;
900 cc->pending_count = pcount;
918 rv = (*cc->doit)(cc->cx, output, &ofraglen, max_output_len,
969 cc->pending_count = pcount;
973 rv = (* cc->doit)(cc->cx, output, &ofraglen, max_output_len,
1019 * cc - the cipher context
1030 * "cc" is the return value from SecCmsCipherStartEncrypt.
1037 * of block boundaries. We save excess bytes between calls in "cc".
1052 SecCmsCipherContextEncrypt(SecCmsCipherContextRef cc, unsigned char *output,
1058 return SecCmsCipherContextCrypt(cc, output,
1068 PORT_Assert (cc->encrypt);
1074 max_needed = SecCmsCipherContextEncryptLength (cc, input_len, final);
1081 bsize = cc->block_size;
1082 padsize = cc->pad_size;
1089 return (*cc->doit)(cc->cx, output, output_len_p, max_output_len,
1093 pcount = cc->pending_count;
1094 pbuf = cc->pending_buf;
1112 cc->pending_count = pcount;
1121 rv = (* cc->doit) (cc->cx, output, &ofraglen, max_output_len,
1151 rv = (* cc->doit) (cc->cx, output, &ofraglen, max_output_len,
1177 rv = (* cc->doit) (cc->cx, output, &ofraglen, max_output_len,
1190 cc->pending_count = pcount;