| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
#include <openssl/dh.h> |
| 19 |
|
| 20 |
#include "stuffer/s2n_stuffer.h" |
| 21 |
#include "utils/s2n_blob.h" |
| 22 |
|
| 23 |
struct s2n_dh_params { |
| 24 |
DH *dh; |
| 25 |
}; |
| 26 |
|
| 27 |
int s2n_pkcs3_to_dh_params(struct s2n_dh_params *dh_params, struct s2n_blob *pkcs3); |
| 28 |
int s2n_dh_p_g_Ys_to_dh_params(struct s2n_dh_params *server_dh_params, struct s2n_blob *p, struct s2n_blob *g, struct s2n_blob *ys); |
| 29 |
int s2n_dh_params_to_p_g_Ys(struct s2n_dh_params *server_dh_params, struct s2n_stuffer *out, struct s2n_blob *output); |
| 30 |
int s2n_dh_compute_shared_secret_as_server(struct s2n_dh_params *server_dh_params, struct s2n_stuffer *Yc_in, struct s2n_blob *shared_key); |
| 31 |
int s2n_dh_compute_shared_secret_as_client(struct s2n_dh_params *server_dh_params, struct s2n_stuffer *Yc_out, struct s2n_blob *shared_key); |
| 32 |
int s2n_dh_params_copy(struct s2n_dh_params *from, struct s2n_dh_params *to); |
| 33 |
int s2n_dh_params_check(struct s2n_dh_params *dh_params); |
| 34 |
int s2n_dh_generate_ephemeral_key(struct s2n_dh_params *dh_params); |
| 35 |
int s2n_dh_params_free(struct s2n_dh_params *dh_params); |