summaryrefslogtreecommitdiff
path: root/digest.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-02-04 11:02:42 +1100
committerDamien Miller <djm@mindrot.org>2014-02-04 11:02:42 +1100
commit4e8d937af79ce4e253f77ec93489d098b25becc3 (patch)
tree83b0293313eea8dfebcc7f906c5058f530238e8b /digest.h
parent69d0d09f76bab5aec86fbf78489169f63bd16475 (diff)
- markus@cvs.openbsd.org 2014/01/27 18:58:14
[Makefile.in digest.c digest.h hostfile.c kex.h mac.c hmac.c hmac.h] replace openssl HMAC with an implementation based on our ssh_digest_* ok and feedback djm@
Diffstat (limited to 'digest.h')
-rw-r--r--digest.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/digest.h b/digest.h
index faefda3f5..0fb207fca 100644
--- a/digest.h
+++ b/digest.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: digest.h,v 1.1 2014/01/09 23:20:00 djm Exp $ */ 1/* $OpenBSD: digest.h,v 1.2 2014/01/27 18:58:14 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2013 Damien Miller <djm@mindrot.org> 3 * Copyright (c) 2013 Damien Miller <djm@mindrot.org>
4 * 4 *
@@ -30,9 +30,18 @@
30#define SSH_DIGEST_SHA512 5 30#define SSH_DIGEST_SHA512 5
31#define SSH_DIGEST_MAX 6 31#define SSH_DIGEST_MAX 6
32 32
33struct ssh_digest_ctx;
34
33/* Returns the algorithm's digest length in bytes or 0 for invalid algorithm */ 35/* Returns the algorithm's digest length in bytes or 0 for invalid algorithm */
34size_t ssh_digest_bytes(int alg); 36size_t ssh_digest_bytes(int alg);
35 37
38/* Returns the block size of the digest, e.g. for implementing HMAC */
39size_t ssh_digest_blocksize(struct ssh_digest_ctx *ctx);
40
41/* Copies internal state of digest of 'from' to 'to' */
42int ssh_digest_copy_state(struct ssh_digest_ctx *from,
43 struct ssh_digest_ctx *to);
44
36/* One-shot API */ 45/* One-shot API */
37int ssh_digest_memory(int alg, const void *m, size_t mlen, 46int ssh_digest_memory(int alg, const void *m, size_t mlen,
38 u_char *d, size_t dlen) 47 u_char *d, size_t dlen)
@@ -42,7 +51,6 @@ int ssh_digest_buffer(int alg, const Buffer *b, u_char *d, size_t dlen)
42 __attribute__((__bounded__(__buffer__, 3, 4))); 51 __attribute__((__bounded__(__buffer__, 3, 4)));
43 52
44/* Update API */ 53/* Update API */
45struct ssh_digest_ctx;
46struct ssh_digest_ctx *ssh_digest_start(int alg); 54struct ssh_digest_ctx *ssh_digest_start(int alg);
47int ssh_digest_update(struct ssh_digest_ctx *ctx, const void *m, size_t mlen) 55int ssh_digest_update(struct ssh_digest_ctx *ctx, const void *m, size_t mlen)
48 __attribute__((__bounded__(__buffer__, 2, 3))); 56 __attribute__((__bounded__(__buffer__, 2, 3)));