summaryrefslogtreecommitdiff
path: root/jpake.h
diff options
context:
space:
mode:
Diffstat (limited to 'jpake.h')
-rw-r--r--jpake.h38
1 files changed, 9 insertions, 29 deletions
diff --git a/jpake.h b/jpake.h
index a3d800cd3..a3f2cf025 100644
--- a/jpake.h
+++ b/jpake.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: jpake.h,v 1.1 2008/11/04 08:22:13 djm Exp $ */ 1/* $OpenBSD: jpake.h,v 1.2 2009/03/05 07:18:19 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2008 Damien Miller. All rights reserved. 3 * Copyright (c) 2008 Damien Miller. All rights reserved.
4 * 4 *
@@ -28,20 +28,16 @@
28# define JPAKE_DEBUG_BUF(a) 28# define JPAKE_DEBUG_BUF(a)
29# define JPAKE_DEBUG_CTX(a) 29# define JPAKE_DEBUG_CTX(a)
30#else 30#else
31# define JPAKE_DEBUG_BN(a) jpake_debug3_bn a 31# define JPAKE_DEBUG_BN(a) debug3_bn a
32# define JPAKE_DEBUG_BUF(a) jpake_debug3_buf a 32# define JPAKE_DEBUG_BUF(a) debug3_buf a
33# define JPAKE_DEBUG_CTX(a) jpake_dump a 33# define JPAKE_DEBUG_CTX(a) jpake_dump a
34#endif /* SCHNORR_DEBUG */ 34#endif /* JPAKE_DEBUG */
35
36struct jpake_group {
37 BIGNUM *p, *q, *g;
38};
39 35
40#define KZP_ID_LEN 16 /* Length of client and server IDs */ 36#define KZP_ID_LEN 16 /* Length of client and server IDs */
41 37
42struct jpake_ctx { 38struct jpake_ctx {
43 /* Parameters */ 39 /* Parameters */
44 struct jpake_group *grp; 40 struct modp_group *grp;
45 41
46 /* Private values shared by client and server */ 42 /* Private values shared by client and server */
47 BIGNUM *s; /* Secret (salted, crypted password) */ 43 BIGNUM *s; /* Secret (salted, crypted password) */
@@ -83,26 +79,18 @@ struct jpake_ctx {
83}; 79};
84 80
85/* jpake.c */ 81/* jpake.c */
86struct jpake_group *jpake_default_group(void); 82struct modp_group *jpake_default_group(void);
87BIGNUM *bn_rand_range_gt_one(const BIGNUM *high);
88int hash_buffer(const u_char *, u_int, const EVP_MD *, u_char **, u_int *);
89void jpake_debug3_bn(const BIGNUM *, const char *, ...)
90 __attribute__((__nonnull__ (2)))
91 __attribute__((format(printf, 2, 3)));
92void jpake_debug3_buf(const u_char *, u_int, const char *, ...)
93 __attribute__((__nonnull__ (3)))
94 __attribute__((format(printf, 3, 4)));
95void jpake_dump(struct jpake_ctx *, const char *, ...) 83void jpake_dump(struct jpake_ctx *, const char *, ...)
96 __attribute__((__nonnull__ (2))) 84 __attribute__((__nonnull__ (2)))
97 __attribute__((format(printf, 2, 3))); 85 __attribute__((format(printf, 2, 3)));
98struct jpake_ctx *jpake_new(void); 86struct jpake_ctx *jpake_new(void);
99void jpake_free(struct jpake_ctx *); 87void jpake_free(struct jpake_ctx *);
100 88
101void jpake_step1(struct jpake_group *, u_char **, u_int *, 89void jpake_step1(struct modp_group *, u_char **, u_int *,
102 BIGNUM **, BIGNUM **, BIGNUM **, BIGNUM **, 90 BIGNUM **, BIGNUM **, BIGNUM **, BIGNUM **,
103 u_char **, u_int *, u_char **, u_int *); 91 u_char **, u_int *, u_char **, u_int *);
104 92
105void jpake_step2(struct jpake_group *, BIGNUM *, 93void jpake_step2(struct modp_group *, BIGNUM *,
106 BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, 94 BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *,
107 const u_char *, u_int, const u_char *, u_int, 95 const u_char *, u_int, const u_char *, u_int,
108 const u_char *, u_int, const u_char *, u_int, 96 const u_char *, u_int, const u_char *, u_int,
@@ -113,7 +101,7 @@ void jpake_confirm_hash(const BIGNUM *,
113 const u_char *, u_int, 101 const u_char *, u_int,
114 u_char **, u_int *); 102 u_char **, u_int *);
115 103
116void jpake_key_confirm(struct jpake_group *, BIGNUM *, BIGNUM *, 104void jpake_key_confirm(struct modp_group *, BIGNUM *, BIGNUM *,
117 BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, 105 BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *, BIGNUM *,
118 const u_char *, u_int, const u_char *, u_int, 106 const u_char *, u_int, const u_char *, u_int,
119 const u_char *, u_int, const u_char *, u_int, 107 const u_char *, u_int, const u_char *, u_int,
@@ -122,13 +110,5 @@ void jpake_key_confirm(struct jpake_group *, BIGNUM *, BIGNUM *,
122int jpake_check_confirm(const BIGNUM *, const u_char *, u_int, 110int jpake_check_confirm(const BIGNUM *, const u_char *, u_int,
123 const u_char *, u_int, const u_char *, u_int); 111 const u_char *, u_int, const u_char *, u_int);
124 112
125/* schnorr.c */
126int schnorr_sign(const BIGNUM *, const BIGNUM *, const BIGNUM *,
127 const BIGNUM *, const BIGNUM *, const u_char *, u_int ,
128 u_char **, u_int *);
129int schnorr_verify(const BIGNUM *, const BIGNUM *, const BIGNUM *,
130 const BIGNUM *, const u_char *, u_int,
131 const u_char *, u_int);
132
133#endif /* JPAKE_H */ 113#endif /* JPAKE_H */
134 114