libssh 0.12.1 The SSH library

Loading...
Searching...
No Matches
ed25519.h
1/*
2 * This file is part of the SSH Library
3 *
4 * Copyright (c) 2014 by Aris Adamantiadis
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef ED25519_H_
22#define ED25519_H_
23#include "libssh/priv.h"
24
31
36#define ED25519_PK_LEN 32
37
42#define ED25519_SK_LEN 64
43
48#define ED25519_SIG_LEN 64
49
55 typedef uint8_t ed25519_pubkey[ED25519_PK_LEN];
56
61 typedef uint8_t ed25519_privkey[ED25519_SK_LEN];
62
67 typedef uint8_t ed25519_signature[ED25519_SIG_LEN];
68
69#ifdef __cplusplus
70 extern "C" {
71#endif
72
79 int crypto_sign_ed25519_keypair(ed25519_pubkey pk, ed25519_privkey sk);
80
91 int crypto_sign_ed25519(
92 unsigned char *sm, uint64_t *smlen,
93 const unsigned char *m, uint64_t mlen,
94 const ed25519_privkey sk);
95
106 int crypto_sign_ed25519_open(
107 unsigned char *m, uint64_t *mlen,
108 const unsigned char *sm, uint64_t smlen,
109 const ed25519_pubkey pk);
110
112#ifdef __cplusplus
113}
114#endif
115
116#endif /* ED25519_H_ */