source: branches/encryption/libtransmission/encryption.h @ 2936

Last change on this file since 2936 was 2936, checked in by charles, 15 years ago

not ready for use yet -- this is a periodic checkin so I don't lose my changes. Outgoing connections work for plaintext, encrypted, and encrypted connections that prefer plaintext. Incoming connections don't work yet. Handshakes aren't wired in to the rest of the peer code yet.

  • Property svn:keywords set to Date Rev Author Id
File size: 2.3 KB
Line 
1/*
2 * This file Copyright (C) 2007 Charles Kerr <charles@rebelbase.com>
3 *
4 * This file is licensed by the GPL version 2.  Works owned by the
5 * Transmission project are granted a special exemption to clause 2(b)
6 * so that the bulk of its code can remain under the MIT license.
7 * This exemption does not extend to derived works not owned by
8 * the Transmission project.
9 *
10 * $Id:$
11 */
12
13#ifndef TR_ENCRYPTION_H
14#define TR_ENCRYPTION_H
15
16#include <inttypes.h>
17
18/**
19***
20**/
21
22struct evbuffer;
23typedef struct tr_encryption tr_encryption;
24
25/**
26***
27**/
28
29tr_encryption*  tr_encryptionNew ( const uint8_t * torrentHash,
30                                   int             isIncoming );
31
32void            tr_encryptionFree( tr_encryption * encryption );
33
34/**
35***
36**/
37
38void            tr_encryptionSetTorrentHash( tr_encryption * encryption,
39                                             const uint8_t * torrentHash );
40
41const uint8_t*  tr_encryptionGetTorrentHash( const tr_encryption * encryption );
42
43/**
44***
45**/
46
47const uint8_t*  tr_encryptionComputeSecret   ( tr_encryption * encryption,
48                                               const uint8_t * peerPublicKey );
49
50const uint8_t*  tr_encryptionGetMyPublicKey ( const tr_encryption * encryption,
51                                              int                 * setme_len );
52
53void            tr_encryptionDecryptInit( tr_encryption * encryption );
54
55void            tr_encryptionDecrypt    ( tr_encryption  * encryption,
56                                          size_t           buflen,
57                                          const void     * buf_in,
58                                          void           * buf_out );
59
60void            tr_encryptionEncryptInit( tr_encryption * encryption );
61
62void            tr_encryptionEncrypt    ( tr_encryption  * encryption,
63                                          size_t           buflen,
64                                          const void     * buf_in,
65                                          void           * buf_out );
66
67/**
68***
69**/
70
71
72
73void            tr_sha1( uint8_t* setme,
74                         const void * content1, int content1_len,
75                         ... );
76
77void            tr_sha1_buf( struct evbuffer* outbuf,
78                             const void * content1, int content1_len,
79                             ... );
80
81/**
82***
83**/
84
85#endif
Note: See TracBrowser for help on using the repository browser.