Added support for SilcSKR in SKE for finding public keys.
[silc.git] / lib / silcske / silcske_i.h
1 /*
2
3   silcske_i.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2005 - 2006 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19
20 #ifndef SILCSKE_I_H
21 #define SILCSKE_I_H
22
23 /* Length of cookie in Start Payload */
24 #define SILC_SKE_COOKIE_LEN 16
25
26 /* SKE context */
27 struct SilcSKEStruct {
28   SilcPacketStream stream;
29   SilcRng rng;
30   SilcSKR repository;
31   SilcSKECallbacks callbacks;
32   void *user_data;
33   SilcSKEStatus status;
34
35   /* Negotiated Security properties.  May be NULL in case of error. */
36   SilcSKESecurityProperties prop;
37
38   /* Key Exchange payloads filled during key negotiation with
39      remote data. Responder may save local data here as well. */
40   SilcSKEStartPayload start_payload;
41   SilcSKEKEPayload ke1_payload;
42   SilcSKEKEPayload ke2_payload;
43
44   /* Temporary copy of the KE Start Payload used in the
45      HASH computation. */
46   SilcBuffer start_payload_copy;
47
48   /* Random number x, 1 < x < q. This is the secret exponent
49      used in Diffie Hellman computations. */
50   SilcMPInt *x;
51
52   /* The secret shared key */
53   SilcMPInt *KEY;
54
55   /* The hash value HASH of the key exchange */
56   unsigned char *hash;
57   SilcUInt32 hash_len;
58
59   char *version;                      /* Local version */
60   char *remote_version;               /* Remote version */
61
62   SilcPublicKey public_key;
63   SilcPrivateKey private_key;
64   SilcSKEPKType pk_type;
65   SilcPacket packet;
66   SilcSKESecurityPropertyFlag flags;
67   SilcSKEKeyMaterial keymat;
68   SilcSKERekeyMaterial rekey;
69   SilcSchedule schedule;
70   SilcFSMStruct fsm;
71   SilcAsyncOperationStruct op;
72
73   unsigned int aborted    : 1;
74   unsigned int responder  : 1;
75 };
76
77 #endif /* SILCSKE_I_H */