Lines Matching refs:ctxt
56 HMAC_context * ctxt;
61 i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize +
63 ctxt = malloc(i);
65 if(!ctxt)
66 return ctxt;
68 ctxt->hmac_hash = hashparams;
69 ctxt->hmac_hashctxt1 = (void *) (ctxt + 1);
70 ctxt->hmac_hashctxt2 = (void *) ((char *) ctxt->hmac_hashctxt1 +
75 (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1);
76 (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, key, keylen);
77 hkey = (unsigned char *) ctxt->hmac_hashctxt2 + hashparams->hmac_ctxtsize;
78 (*hashparams->hmac_hfinal)(hkey, ctxt->hmac_hashctxt1);
84 (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1);
85 (*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2);
89 (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1);
91 (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1);
95 (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &hmac_ipad, 1);
96 (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &hmac_opad, 1);
100 return ctxt;
103 int Curl_HMAC_update(HMAC_context * ctxt,
108 (*ctxt->hmac_hash->hmac_hupdate)(ctxt->hmac_hashctxt1, data, len);
113 int Curl_HMAC_final(HMAC_context * ctxt, unsigned char * result)
115 const HMAC_params * hashparams = ctxt->hmac_hash;
121 result = (unsigned char *) ctxt->hmac_hashctxt2 +
122 ctxt->hmac_hash->hmac_ctxtsize;
124 (*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt1);
125 (*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2,
127 (*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt2);
128 free((char *) ctxt);