Lines Matching refs:digest
148 const struct ssh_digest *digest = ssh_digest_by_alg(alg); in ssh_digest_alg_name() local
150 return digest == NULL ? NULL : digest->name; in ssh_digest_alg_name()
156 const struct ssh_digest *digest = ssh_digest_by_alg(alg); in ssh_digest_bytes() local
158 return digest == NULL ? 0 : digest->digest_len; in ssh_digest_bytes()
164 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg); in ssh_digest_blocksize() local
166 return digest == NULL ? 0 : digest->block_len; in ssh_digest_blocksize()
172 const struct ssh_digest *digest = ssh_digest_by_alg(alg); in ssh_digest_start() local
175 if (digest == NULL || (ret = calloc(1, sizeof(*ret))) == NULL) in ssh_digest_start()
177 if ((ret->mdctx = calloc(1, digest->ctx_len)) == NULL) { in ssh_digest_start()
182 digest->md_init(ret->mdctx); in ssh_digest_start()
189 const struct ssh_digest *digest = ssh_digest_by_alg(from->alg); in ssh_digest_copy_state() local
191 if (digest == NULL || from->alg != to->alg) in ssh_digest_copy_state()
193 memcpy(to->mdctx, from->mdctx, digest->ctx_len); in ssh_digest_copy_state()
200 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg); in ssh_digest_update() local
202 if (digest == NULL) in ssh_digest_update()
204 digest->md_update(ctx->mdctx, m, mlen); in ssh_digest_update()
217 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg); in ssh_digest_final() local
219 if (digest == NULL) in ssh_digest_final()
223 if (dlen < digest->digest_len) /* No truncation allowed */ in ssh_digest_final()
225 digest->md_final(d, ctx->mdctx); in ssh_digest_final()
232 const struct ssh_digest *digest; in ssh_digest_free() local
235 digest = ssh_digest_by_alg(ctx->alg); in ssh_digest_free()
236 if (digest) { in ssh_digest_free()
237 explicit_bzero(ctx->mdctx, digest->ctx_len); in ssh_digest_free()