Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/ttssh2/ttxssh/ed25519_crypto_api.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/ssh_ed25519/ttssh2/ttxssh/sftp.h revision 5495 by yutakapon, Sun Mar 2 15:17:04 2014 UTC branches/ssh_ed25519/ttssh2/ttxssh/ed25519_crypto_api.h revision 5496 by yutakapon, Mon Mar 3 06:59:21 2014 UTC
# Line 1  Line 1 
1  /*  /*
2  Copyright (c) 2008-2012 TeraTerm Project  Copyright (c) 2004-2014 TeraTerm Project
3  All rights reserved.  All rights reserved.
4    
5  Redistribution and use in source and binary forms, with or without modification,  Redistribution and use in source and binary forms, with or without modification,
# Line 24  ARISING IN ANY WAY OUT OF THE USE OF THI Line 24  ARISING IN ANY WAY OUT OF THE USE OF THI
24  OF SUCH DAMAGE.  OF SUCH DAMAGE.
25  */  */
26    
27  #ifndef __SFTP_H  #ifndef __ED25519_CRYPTO_API_H
28  #define __SFTP_H  #define __ED25519_CRYPTO_API_H
29    
30  // for debug mode  typedef int crypto_int32;
31  #ifdef _DEBUG  typedef unsigned int crypto_uint32;
32  #define SFTP_DEBUG  
33  #endif  #define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len))
34    
35    #define crypto_hashblocks_sha512_STATEBYTES 64U
36    #define crypto_hashblocks_sha512_BLOCKBYTES 128U
37    
38    int     crypto_hashblocks_sha512(unsigned char *, const unsigned char *,
39         unsigned long long);
40    
41  /* version */  #define crypto_hash_sha512_BYTES 64U
 #define SSH2_FILEXFER_VERSION           3  
42    
43  /* client to server */  int     crypto_hash_sha512(unsigned char *, const unsigned char *,
44  #define SSH2_FXP_INIT                   1      unsigned long long);
 #define SSH2_FXP_OPEN                   3  
 #define SSH2_FXP_CLOSE                  4  
 #define SSH2_FXP_READ                   5  
 #define SSH2_FXP_WRITE                  6  
 #define SSH2_FXP_LSTAT                  7  
 #define SSH2_FXP_STAT_VERSION_0         7  
 #define SSH2_FXP_FSTAT                  8  
 #define SSH2_FXP_SETSTAT                9  
 #define SSH2_FXP_FSETSTAT               10  
 #define SSH2_FXP_OPENDIR                11  
 #define SSH2_FXP_READDIR                12  
 #define SSH2_FXP_REMOVE                 13  
 #define SSH2_FXP_MKDIR                  14  
 #define SSH2_FXP_RMDIR                  15  
 #define SSH2_FXP_REALPATH               16  
 #define SSH2_FXP_STAT                   17  
 #define SSH2_FXP_RENAME                 18  
 #define SSH2_FXP_READLINK               19  
 #define SSH2_FXP_SYMLINK                20  
   
 /* server to client */  
 #define SSH2_FXP_VERSION                2  
 #define SSH2_FXP_STATUS                 101  
 #define SSH2_FXP_HANDLE                 102  
 #define SSH2_FXP_DATA                   103  
 #define SSH2_FXP_NAME                   104  
 #define SSH2_FXP_ATTRS                  105  
   
 #define SSH2_FXP_EXTENDED               200  
 #define SSH2_FXP_EXTENDED_REPLY         201  
   
 /* attributes */  
 #define SSH2_FILEXFER_ATTR_SIZE         0x00000001  
 #define SSH2_FILEXFER_ATTR_UIDGID       0x00000002  
 #define SSH2_FILEXFER_ATTR_PERMISSIONS  0x00000004  
 #define SSH2_FILEXFER_ATTR_ACMODTIME    0x00000008  
 #define SSH2_FILEXFER_ATTR_EXTENDED     0x80000000  
   
 /* portable open modes */  
 #define SSH2_FXF_READ                   0x00000001  
 #define SSH2_FXF_WRITE                  0x00000002  
 #define SSH2_FXF_APPEND                 0x00000004  
 #define SSH2_FXF_CREAT                  0x00000008  
 #define SSH2_FXF_TRUNC                  0x00000010  
 #define SSH2_FXF_EXCL                   0x00000020  
   
 /* statvfs@openssh.com f_flag flags */  
 #define SSH2_FXE_STATVFS_ST_RDONLY      0x00000001  
 #define SSH2_FXE_STATVFS_ST_NOSUID      0x00000002  
   
 /* status messages */  
 #define SSH2_FX_OK                      0  
 #define SSH2_FX_EOF                     1  
 #define SSH2_FX_NO_SUCH_FILE            2  
 #define SSH2_FX_PERMISSION_DENIED       3  
 #define SSH2_FX_FAILURE                 4  
 #define SSH2_FX_BAD_MESSAGE             5  
 #define SSH2_FX_NO_CONNECTION           6  
 #define SSH2_FX_CONNECTION_LOST         7  
 #define SSH2_FX_OP_UNSUPPORTED          8  
 #define SSH2_FX_MAX                     8  
45    
46  /* Maximum packet that we are willing to send/accept */  int     crypto_verify_32(const unsigned char *, const unsigned char *);
 #define SFTP_MAX_MSG_LENGTH     (256 * 1024)  
47    
48  #define DEFAULT_COPY_BUFLEN 32768   /* Size of buffer for up/download */  #define crypto_sign_ed25519_SECRETKEYBYTES 64U
49  #define DEFAULT_NUM_REQUESTS    64  /* # concurrent outstanding requests */  #define crypto_sign_ed25519_PUBLICKEYBYTES 32U
50    #define crypto_sign_ed25519_BYTES 64U
51    
52  void sftp_do_init(PTInstVar pvar, Channel_t *c);  int     crypto_sign_ed25519(unsigned char *, unsigned long long *,
53  void sftp_response(PTInstVar pvar, Channel_t *c, unsigned char *data, unsigned int buflen);      const unsigned char *, unsigned long long, const unsigned char *);
54    int     crypto_sign_ed25519_open(unsigned char *, unsigned long long *,
55        const unsigned char *, unsigned long long, const unsigned char *);
56    int     crypto_sign_ed25519_keypair(unsigned char *, unsigned char *);
57    
58  #endif  #endif

Legend:
Removed from v.5495  
changed lines
  Added in v.5496

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26