comparison dh_groups.c @ 1702:8f93f37c01de

Allow DH to be completely disabled (#97) Reduces binary size by ~2kB by default and by 21kB with no other libtommath functions users, ex. with curve25519 kex and ed25519 key only.
author Vladislav Grishenko <themiron@users.noreply.github.com>
date Thu, 28 May 2020 20:01:48 +0500
parents 5d560c68c70c
children ee6ccc2ecc47
comparison
equal deleted inserted replaced
1701:6e5037ae2c1c 1702:8f93f37c01de
1 #include "options.h" 1 #include "options.h"
2 #include "dh_groups.h" 2 #include "dh_groups.h"
3
4 #if DROPBEAR_DH_NORMAL
3 5
4 #if DROPBEAR_DH_GROUP1 6 #if DROPBEAR_DH_GROUP1
5 /* diffie-hellman-group1-sha1 value for p */ 7 /* diffie-hellman-group1-sha1 value for p */
6 const unsigned char dh_p_1[DH_P_1_LEN] = { 8 const unsigned char dh_p_1[DH_P_1_LEN] = {
7 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2, 9 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2,
90 #endif /* DROPBEAR_DH_GROUP16 */ 92 #endif /* DROPBEAR_DH_GROUP16 */
91 93
92 /* Same for all groups */ 94 /* Same for all groups */
93 const int DH_G_VAL = 2; 95 const int DH_G_VAL = 2;
94 96
97 #endif