version 1.3, 2009/03/05 07:18:19 |
version 1.4, 2010/09/20 04:50:53 |
|
|
error("%s: g_x < 1", __func__); |
error("%s: g_x < 1", __func__); |
return -1; |
return -1; |
} |
} |
|
if (BN_cmp(g_x, grp_p) >= 0) { |
|
error("%s: g_x > g", __func__); |
|
return -1; |
|
} |
|
|
h = g_v = r = tmp = v = NULL; |
h = g_v = r = tmp = v = NULL; |
if ((bn_ctx = BN_CTX_new()) == NULL) { |
if ((bn_ctx = BN_CTX_new()) == NULL) { |
|
|
/* Avoid degenerate cases: g^0 yields a spoofable signature */ |
/* Avoid degenerate cases: g^0 yields a spoofable signature */ |
if (BN_cmp(g_x, BN_value_one()) <= 0) { |
if (BN_cmp(g_x, BN_value_one()) <= 0) { |
error("%s: g_x < 1", __func__); |
error("%s: g_x < 1", __func__); |
|
return -1; |
|
} |
|
if (BN_cmp(g_x, grp_p) >= 0) { |
|
error("%s: g_x >= p", __func__); |
return -1; |
return -1; |
} |
} |
|
|