Blame include/libssh/curve25519.h

Packit Service 31306d
/*
Packit Service 31306d
 * This file is part of the SSH Library
Packit Service 31306d
 *
Packit Service 31306d
 * Copyright (c) 2013 by Aris Adamantiadis <aris@badcode.be>
Packit Service 31306d
 *
Packit Service 31306d
 * This library is free software; you can redistribute it and/or
Packit Service 31306d
 * modify it under the terms of the GNU Lesser General Public
Packit Service 31306d
 * License as published by the Free Software Foundation,
Packit Service 31306d
 * version 2.1 of the License.
Packit Service 31306d
 *
Packit Service 31306d
 * This library is distributed in the hope that it will be useful,
Packit Service 31306d
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 31306d
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 31306d
 * Lesser General Public License for more details.
Packit Service 31306d
 *
Packit Service 31306d
 * You should have received a copy of the GNU Lesser General Public
Packit Service 31306d
 * License along with this library; if not, write to the Free Software
Packit Service 31306d
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Packit Service 31306d
 */
Packit Service 31306d
Packit Service 31306d
#ifndef CURVE25519_H_
Packit Service 31306d
#define CURVE25519_H_
Packit Service 31306d
Packit Service 31306d
#include "config.h"
Packit Service 31306d
#include "libssh.h"
Packit Service 31306d
Packit Service 31306d
#ifdef WITH_NACL
Packit Service 31306d
Packit Service 31306d
#include <nacl/crypto_scalarmult_curve25519.h>
Packit Service 31306d
#define CURVE25519_PUBKEY_SIZE crypto_scalarmult_curve25519_BYTES
Packit Service 31306d
#define CURVE25519_PRIVKEY_SIZE crypto_scalarmult_curve25519_SCALARBYTES
Packit Service 31306d
#define crypto_scalarmult_base crypto_scalarmult_curve25519_base
Packit Service 31306d
#define crypto_scalarmult crypto_scalarmult_curve25519
Packit Service 31306d
#else
Packit Service 31306d
Packit Service 31306d
#define CURVE25519_PUBKEY_SIZE 32
Packit Service 31306d
#define CURVE25519_PRIVKEY_SIZE 32
Packit Service 31306d
int crypto_scalarmult_base(unsigned char *q, const unsigned char *n);
Packit Service 31306d
int crypto_scalarmult(unsigned char *q, const unsigned char *n, const unsigned char *p);
Packit Service 31306d
#endif /* WITH_NACL */
Packit Service 31306d
Packit Service 31306d
#ifdef HAVE_ECC
Packit Service 31306d
#define HAVE_CURVE25519 1
Packit Service 31306d
#endif
Packit Service 31306d
Packit Service 31306d
typedef unsigned char ssh_curve25519_pubkey[CURVE25519_PUBKEY_SIZE];
Packit Service 31306d
typedef unsigned char ssh_curve25519_privkey[CURVE25519_PRIVKEY_SIZE];
Packit Service 31306d
Packit Service 31306d
Packit Service 31306d
int ssh_client_curve25519_init(ssh_session session);
Packit Service 31306d
Packit Service 31306d
#ifdef WITH_SERVER
Packit Service 31306d
void ssh_server_curve25519_init(ssh_session session);
Packit Service 31306d
#endif /* WITH_SERVER */
Packit Service 31306d
Packit Service 31306d
#endif /* CURVE25519_H_ */