Lines Matching refs:digest

152 	const struct ssh_digest *digest = ssh_digest_by_alg(alg);  in ssh_digest_alg_name()  local
154 return digest == NULL ? NULL : digest->name; in ssh_digest_alg_name()
160 const struct ssh_digest *digest = ssh_digest_by_alg(alg); in ssh_digest_bytes() local
162 return digest == NULL ? 0 : digest->digest_len; in ssh_digest_bytes()
168 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg); in ssh_digest_blocksize() local
170 return digest == NULL ? 0 : digest->block_len; in ssh_digest_blocksize()
176 const struct ssh_digest *digest = ssh_digest_by_alg(alg); in ssh_digest_start() local
179 if (digest == NULL || (ret = calloc(1, sizeof(*ret))) == NULL) in ssh_digest_start()
181 if ((ret->mdctx = calloc(1, digest->ctx_len)) == NULL) { in ssh_digest_start()
186 digest->md_init(ret->mdctx); in ssh_digest_start()
193 const struct ssh_digest *digest = ssh_digest_by_alg(from->alg); in ssh_digest_copy_state() local
195 if (digest == NULL || from->alg != to->alg) in ssh_digest_copy_state()
197 memcpy(to->mdctx, from->mdctx, digest->ctx_len); in ssh_digest_copy_state()
204 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg); in ssh_digest_update() local
206 if (digest == NULL) in ssh_digest_update()
208 digest->md_update(ctx->mdctx, m, mlen); in ssh_digest_update()
221 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg); in ssh_digest_final() local
223 if (digest == NULL) in ssh_digest_final()
227 if (dlen < digest->digest_len) /* No truncation allowed */ in ssh_digest_final()
229 digest->md_final(d, ctx->mdctx); in ssh_digest_final()
236 const struct ssh_digest *digest; in ssh_digest_free() local
239 digest = ssh_digest_by_alg(ctx->alg); in ssh_digest_free()
240 if (digest) { in ssh_digest_free()
241 explicit_bzero(ctx->mdctx, digest->ctx_len); in ssh_digest_free()