Develop and Download Open Source Software

Browse Subversion Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5496 - (show annotations) (download) (as text)
Mon Mar 3 06:59:21 2014 UTC (10 years, 1 month ago) by yutakapon
Original Path: branches/ssh_ed25519/ttssh2/ttxssh/ed25519_crypto_api.h
File MIME type: text/x-chdr
File size: 2545 byte(s)
Key Generator に ED25519 の定義を追加した。
鍵生成に必要となるモジュールの仮追加。

1 /*
2 Copyright (c) 2004-2014 TeraTerm Project
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without modification,
6 are permitted provided that the following conditions are met:
7
8 1. Redistributions of source code must retain the above copyright notice,
9 this list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
13 3. The name of the author may not be used to endorse or promote products derived
14 from this software without specific prior written permission.
15
16 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
17 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
19 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
21 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
24 OF SUCH DAMAGE.
25 */
26
27 #ifndef __ED25519_CRYPTO_API_H
28 #define __ED25519_CRYPTO_API_H
29
30 typedef int crypto_int32;
31 typedef unsigned int crypto_uint32;
32
33 #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 #define crypto_hash_sha512_BYTES 64U
42
43 int crypto_hash_sha512(unsigned char *, const unsigned char *,
44 unsigned long long);
45
46 int crypto_verify_32(const unsigned char *, const unsigned char *);
47
48 #define crypto_sign_ed25519_SECRETKEYBYTES 64U
49 #define crypto_sign_ed25519_PUBLICKEYBYTES 32U
50 #define crypto_sign_ed25519_BYTES 64U
51
52 int crypto_sign_ed25519(unsigned char *, unsigned long long *,
53 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

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