Coverage Report

Created: 2023-03-06 09:27

/src/dropbear/ecdsa.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef DROPBEAR_ECDSA_H_
2
#define DROPBEAR_ECDSA_H_
3
4
#include "includes.h"
5
#include "buffer.h"
6
#include "signkey.h"
7
8
#if DROPBEAR_ECDSA
9
10
/* prefer 256 or 384 since those are SHOULD for
11
   draft-ietf-curdle-ssh-kex-sha2.txt */
12
#if DROPBEAR_ECC_256
13
0
#define ECDSA_DEFAULT_SIZE 256
14
#elif DROPBEAR_ECC_384
15
#define ECDSA_DEFAULT_SIZE 384
16
#elif DROPBEAR_ECC_521
17
#define ECDSA_DEFAULT_SIZE 521
18
#else
19
#error ECDSA cannot be enabled without enabling at least one size (256, 384, 521)
20
#endif
21
22
ecc_key *gen_ecdsa_priv_key(unsigned int bit_size);
23
ecc_key *buf_get_ecdsa_pub_key(buffer* buf);
24
ecc_key *buf_get_ecdsa_priv_key(buffer *buf);
25
void buf_put_ecdsa_pub_key(buffer *buf, ecc_key *key);
26
void buf_put_ecdsa_priv_key(buffer *buf, ecc_key *key);
27
enum signkey_type ecdsa_signkey_type(const ecc_key * key);
28
29
void buf_put_ecdsa_sign(buffer *buf, const ecc_key *key, const buffer *data_buf);
30
int buf_ecdsa_verify(buffer *buf, const ecc_key *key, const buffer *data_buf);
31
/* Returns 1 on success */
32
int signkey_is_ecdsa(enum signkey_type type);
33
34
#endif
35
36
#endif /* DROPBEAR_ECDSA_H_ */