diff options
Diffstat (limited to 'src/lib/libcrypto/gost/gost89_params.c')
| -rw-r--r-- | src/lib/libcrypto/gost/gost89_params.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/libcrypto/gost/gost89_params.c b/src/lib/libcrypto/gost/gost89_params.c index 2b2607d24b..35d8f62fe9 100644 --- a/src/lib/libcrypto/gost/gost89_params.c +++ b/src/lib/libcrypto/gost/gost89_params.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: gost89_params.c,v 1.1 2014/11/09 19:17:13 miod Exp $ */ | 1 | /* $OpenBSD: gost89_params.c,v 1.2 2014/11/09 23:06:52 miod Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 3 | * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
| 4 | * Copyright (c) 2005-2006 Cryptocom LTD | 4 | * Copyright (c) 2005-2006 Cryptocom LTD |
| @@ -179,7 +179,8 @@ static const struct gost89_parameters_info { | |||
| 179 | {NID_undef,NULL,0} | 179 | {NID_undef,NULL,0} |
| 180 | }; | 180 | }; |
| 181 | 181 | ||
| 182 | int Gost2814789_set_sbox(GOST2814789_KEY *key, int nid) | 182 | int |
| 183 | Gost2814789_set_sbox(GOST2814789_KEY *key, int nid) | ||
| 183 | { | 184 | { |
| 184 | int i; | 185 | int i; |
| 185 | const gost_subst_block *b = NULL; | 186 | const gost_subst_block *b = NULL; |
| @@ -194,7 +195,7 @@ int Gost2814789_set_sbox(GOST2814789_KEY *key, int nid) | |||
| 194 | break; | 195 | break; |
| 195 | } | 196 | } |
| 196 | 197 | ||
| 197 | if (!b) | 198 | if (b == NULL) |
| 198 | return 0; | 199 | return 0; |
| 199 | 200 | ||
| 200 | for (i = 0; i < 256; i++) { | 201 | for (i = 0; i < 256; i++) { |
| @@ -211,8 +212,9 @@ int Gost2814789_set_sbox(GOST2814789_KEY *key, int nid) | |||
| 211 | return 1; | 212 | return 1; |
| 212 | } | 213 | } |
| 213 | 214 | ||
| 214 | int Gost2814789_set_key(GOST2814789_KEY *key, | 215 | int |
| 215 | const unsigned char *userKey, const int bits) | 216 | Gost2814789_set_key(GOST2814789_KEY *key, const unsigned char *userKey, |
| 217 | const int bits) | ||
| 216 | { | 218 | { |
| 217 | int i; | 219 | int i; |
| 218 | 220 | ||
| @@ -227,7 +229,8 @@ int Gost2814789_set_key(GOST2814789_KEY *key, | |||
| 227 | return 1; | 229 | return 1; |
| 228 | } | 230 | } |
| 229 | 231 | ||
| 230 | void Gost2814789_cryptopro_key_mesh(GOST2814789_KEY *key) | 232 | void |
| 233 | Gost2814789_cryptopro_key_mesh(GOST2814789_KEY *key) | ||
| 231 | { | 234 | { |
| 232 | unsigned char newkey[32]; | 235 | unsigned char newkey[32]; |
| 233 | 236 | ||
