1
0
mirror of http://galexander.org/git/simplesshd.git synced 2024-11-30 11:18:12 +00:00
simplesshd/dropbear/ecdsa.h

37 lines
1.0 KiB
C
Raw Normal View History

2019-06-09 20:44:26 +00:00
#ifndef DROPBEAR_ECDSA_H_
#define DROPBEAR_ECDSA_H_
2014-12-10 21:56:49 +00:00
#include "includes.h"
#include "buffer.h"
#include "signkey.h"
2019-06-09 20:44:26 +00:00
#if DROPBEAR_ECDSA
2014-12-10 21:56:49 +00:00
2019-06-09 20:44:26 +00:00
/* prefer 256 or 384 since those are SHOULD for
draft-ietf-curdle-ssh-kex-sha2.txt */
#if DROPBEAR_ECC_256
2014-12-10 21:56:49 +00:00
#define ECDSA_DEFAULT_SIZE 256
2019-06-09 20:44:26 +00:00
#elif DROPBEAR_ECC_384
#define ECDSA_DEFAULT_SIZE 384
#elif DROPBEAR_ECC_521
#define ECDSA_DEFAULT_SIZE 521
2014-12-10 21:56:49 +00:00
#else
2019-06-09 20:44:26 +00:00
#error ECDSA cannot be enabled without enabling at least one size (256, 384, 521)
2014-12-10 21:56:49 +00:00
#endif
ecc_key *gen_ecdsa_priv_key(unsigned int bit_size);
ecc_key *buf_get_ecdsa_pub_key(buffer* buf);
ecc_key *buf_get_ecdsa_priv_key(buffer *buf);
void buf_put_ecdsa_pub_key(buffer *buf, ecc_key *key);
void buf_put_ecdsa_priv_key(buffer *buf, ecc_key *key);
2019-06-09 20:44:26 +00:00
enum signkey_type ecdsa_signkey_type(const ecc_key * key);
2014-12-10 21:56:49 +00:00
2019-06-09 20:44:26 +00:00
void buf_put_ecdsa_sign(buffer *buf, const ecc_key *key, const buffer *data_buf);
int buf_ecdsa_verify(buffer *buf, const ecc_key *key, const buffer *data_buf);
2014-12-10 21:56:49 +00:00
/* Returns 1 on success */
int signkey_is_ecdsa(enum signkey_type type);
#endif
2019-06-09 20:44:26 +00:00
#endif /* DROPBEAR_ECDSA_H_ */