Lines Matching refs:ctxt

58   struct HMAC_context *ctxt;  in Curl_HMAC_init()  local
63 i = sizeof(*ctxt) + 2 * hashparams->ctxtsize + hashparams->resultlen; in Curl_HMAC_init()
64 ctxt = malloc(i); in Curl_HMAC_init()
66 if(!ctxt) in Curl_HMAC_init()
67 return ctxt; in Curl_HMAC_init()
69 ctxt->hash = hashparams; in Curl_HMAC_init()
70 ctxt->hashctxt1 = (void *) (ctxt + 1); in Curl_HMAC_init()
71 ctxt->hashctxt2 = (void *) ((char *) ctxt->hashctxt1 + hashparams->ctxtsize); in Curl_HMAC_init()
75 hashparams->hinit(ctxt->hashctxt1); in Curl_HMAC_init()
76 hashparams->hupdate(ctxt->hashctxt1, key, keylen); in Curl_HMAC_init()
77 hkey = (unsigned char *) ctxt->hashctxt2 + hashparams->ctxtsize; in Curl_HMAC_init()
78 hashparams->hfinal(hkey, ctxt->hashctxt1); in Curl_HMAC_init()
84 hashparams->hinit(ctxt->hashctxt1); in Curl_HMAC_init()
85 hashparams->hinit(ctxt->hashctxt2); in Curl_HMAC_init()
89 hashparams->hupdate(ctxt->hashctxt1, &b, 1); in Curl_HMAC_init()
91 hashparams->hupdate(ctxt->hashctxt2, &b, 1); in Curl_HMAC_init()
95 hashparams->hupdate(ctxt->hashctxt1, &hmac_ipad, 1); in Curl_HMAC_init()
96 hashparams->hupdate(ctxt->hashctxt2, &hmac_opad, 1); in Curl_HMAC_init()
100 return ctxt; in Curl_HMAC_init()
103 int Curl_HMAC_update(struct HMAC_context *ctxt, in Curl_HMAC_update() argument
108 ctxt->hash->hupdate(ctxt->hashctxt1, ptr, len); in Curl_HMAC_update()
113 int Curl_HMAC_final(struct HMAC_context *ctxt, unsigned char *output) in Curl_HMAC_final() argument
115 const struct HMAC_params *hashparams = ctxt->hash; in Curl_HMAC_final()
121 output = (unsigned char *) ctxt->hashctxt2 + ctxt->hash->ctxtsize; in Curl_HMAC_final()
123 hashparams->hfinal(output, ctxt->hashctxt1); in Curl_HMAC_final()
124 hashparams->hupdate(ctxt->hashctxt2, output, hashparams->resultlen); in Curl_HMAC_final()
125 hashparams->hfinal(output, ctxt->hashctxt2); in Curl_HMAC_final()
126 free(ctxt); in Curl_HMAC_final()
152 struct HMAC_context *ctxt = in Curl_hmacit() local
155 if(!ctxt) in Curl_hmacit()
159 Curl_HMAC_update(ctxt, buf, curlx_uztoui(buflen)); in Curl_hmacit()
162 Curl_HMAC_final(ctxt, output); in Curl_hmacit()