source: branches/encryption/libtransmission/crypto.h @ 2938

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

make things a little less prolix - s/tr_encryption/tr_crypto/

  • Property svn:keywords set to Date Rev Author Id
File size: 1.9 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: crypto.h 2938 2007-08-29 12:24:34Z charles $
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_crypto tr_crypto;
24
25/**
26***
27**/
28
29tr_crypto*  tr_cryptoNew ( const uint8_t * torrentHash,
30                           int             isIncoming );
31
32void            tr_cryptoFree( tr_crypto * crypto );
33
34/**
35***
36**/
37
38void            tr_cryptoSetTorrentHash( tr_crypto     * crypto,
39                                         const uint8_t * torrentHash );
40
41const uint8_t*  tr_cryptoGetTorrentHash( const tr_crypto * crypto );
42
43/**
44***
45**/
46
47const uint8_t*  tr_cryptoComputeSecret   ( tr_crypto     * crypto,
48                                           const uint8_t * peerPublicKey );
49
50const uint8_t*  tr_cryptoGetMyPublicKey ( const tr_crypto * crypto,
51                                          int             * setme_len );
52
53void            tr_cryptoDecryptInit( tr_crypto   * crypto );
54
55void            tr_cryptoDecrypt    ( tr_crypto   * crypto,
56                                      size_t        buflen,
57                                      const void  * buf_in,
58                                      void        * buf_out );
59
60void            tr_cryptoEncryptInit( tr_crypto   * crypto );
61
62void            tr_cryptoEncrypt    ( tr_crypto   * crypto,
63                                      size_t        buflen,
64                                      const void  * buf_in,
65                                      void        * buf_out );
66
67/**
68***
69**/
70
71void  tr_sha1( uint8_t* setme,
72               const void * content1, int content1_len,
73               ... );
74
75/**
76***
77**/
78
79#endif
Note: See TracBrowser for help on using the repository browser.