• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/Security-55471.14.18/libsecurity_comcryption/lib/

Lines Matching refs:cbuf

120 void mallocCodeBufs(comcryptBuf *cbuf)
128 cbuf->codeBufSize = comcryptMaxOutBufSize(NULL,
132 cbuf->codeBuf = (unsigned char *)ascMalloc(cbuf->codeBufSize);
138 cbuf->level2BufSize = comcryptMaxOutBufSize(NULL,
142 cbuf->level2Buf = (unsigned char *)ascMalloc(cbuf->level2BufSize);
144 cbuf->queue = (queueElt *)ascMalloc(sizeof(queueElt) * QLEN);
155 cbuf->lookAhead = (unsigned char *)ascMalloc(LOOKAHEAD_SIZE);
157 cbuf->lookAhead = NULL;
163 cbuf->sigArray = (unsigned *)ascMalloc((MAX_TOKENS + 1) * sizeof(unsigned));
167 comcryptBuf *cbuf,
177 cbuf->nybbleDex = khash;
180 memset(cbuf->lookAhead, 0, LOOKAHEAD_SIZE);
191 cbuf->queue[ct] = qval;
193 markInQueue(cbuf, qval, 1);
196 // note cbuf->nybbleDex = khash on return...
198 cbuf->f1 = F1_DEFAULT;
199 cbuf->f2 = F2_DEFAULT;
200 cbuf->jmatchThresh = THRESH_2LEVEL_JMATCH_DEF;
201 cbuf->minByteCode = THRESH_2LEVEL_NUMBYTECODES_DEF;
203 initSigSequence(cbuf, key, keyLen);
207 void freeCodeBufs(comcryptBuf *cbuf)
209 if(cbuf->queue != NULL) {
210 ascFree(cbuf->queue);
212 if(cbuf->codeBuf != NULL) {
213 ascFree(cbuf->codeBuf);
215 if(cbuf->level2Buf != NULL) {
216 ascFree(cbuf->level2Buf);
218 if(cbuf->nextBuf != NULL) {
219 freeCodeBufs(cbuf->nextBuf);
220 ascFree(cbuf->nextBuf);
221 cbuf->nextBuf = NULL;
223 if(cbuf->lookAhead != NULL) {
224 ascFree(cbuf->lookAhead);
226 if(cbuf->sigArray != NULL) {
227 ascFree(cbuf->sigArray);
258 return cpriv->cbuf.f1;
265 cpriv->cbuf.f1 = f1;
266 if(cpriv->cbuf.nextBuf != NULL) {
267 cpriv->cbuf.nextBuf->f1 = f1;
275 return cpriv->cbuf.f2;
282 cpriv->cbuf.f2 = f2;
283 if(cpriv->cbuf.nextBuf != NULL) {
284 cpriv->cbuf.nextBuf->f2 = f2;
292 return cpriv->cbuf.jmatchThresh;
299 cpriv->cbuf.jmatchThresh = jmatchThresh;
300 if(cpriv->cbuf.nextBuf != NULL) {
301 cpriv->cbuf.nextBuf->jmatchThresh = jmatchThresh;
309 return cpriv->cbuf.minByteCode;
316 cpriv->cbuf.minByteCode = minByteCode;
317 if(cpriv->cbuf.nextBuf != NULL) {
318 cpriv->cbuf.nextBuf->minByteCode = minByteCode;
330 int testLookAhead(comcryptBuf *cbuf, int i1, int i2)
334 if(!cbuf->laEnable) {
338 if(!inQueue(cbuf, cbuf->queue[i])) {
346 //return initTestLookAhead(cbuf);
350 int initTestLookAhead(comcryptBuf *cbuf)
357 unsigned char *la = cbuf->lookAhead;
369 if(cbuf->queue[i] == codeWord) {
392 void initSigSequence(comcryptBuf *cbuf,
406 cbuf->sigArray[0] = (unsigned short)seed;
413 void nextSigWord(comcryptBuf *cbuf,
419 unsigned short *sigArray = cbuf->sigArray;
447 void sigMunge(comcryptBuf *cbuf,
458 sig = cbuf->sigArray[token];