Lines Matching defs:ctx
146 ssh_digest_blocksize(struct ssh_digest_ctx *ctx)
148 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg);
182 ssh_digest_update(struct ssh_digest_ctx *ctx, const void *m, size_t mlen)
184 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg);
188 digest->md_update(ctx->mdctx, m, mlen);
193 ssh_digest_update_buffer(struct ssh_digest_ctx *ctx, const struct sshbuf *b)
195 return ssh_digest_update(ctx, sshbuf_ptr(b), sshbuf_len(b));
199 ssh_digest_final(struct ssh_digest_ctx *ctx, u_char *d, size_t dlen)
201 const struct ssh_digest *digest = ssh_digest_by_alg(ctx->alg);
209 digest->md_final(d, ctx->mdctx);
214 ssh_digest_free(struct ssh_digest_ctx *ctx)
218 if (ctx != NULL) {
219 digest = ssh_digest_by_alg(ctx->alg);
221 explicit_bzero(ctx->mdctx, digest->ctx_len);
222 free(ctx->mdctx);
223 freezero(ctx, sizeof(*ctx));
231 struct ssh_digest_ctx *ctx = ssh_digest_start(alg);
233 if (ctx == NULL)
235 if (ssh_digest_update(ctx, m, mlen) != 0 ||
236 ssh_digest_final(ctx, d, dlen) != 0)
238 ssh_digest_free(ctx);