diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-05 17:35:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-05 17:35:25 +0000 |
commit | 62cb95a862cb8d730b8c87930195332a54f26dca (patch) | |
tree | ae4673a67e3a4bbb01665dadb88b506256bc4090 /src/include/gnunet_crypto_lib.h | |
parent | 5ff9d6c06021db8efad154660843ed4f3617fd98 (diff) | |
download | gnunet-62cb95a862cb8d730b8c87930195332a54f26dca.tar.gz gnunet-62cb95a862cb8d730b8c87930195332a54f26dca.zip |
Werner Koch wrote:
Hi,
find attach the patch which makes all 3 test cases work with Ed25519.
There are some minor hacks in the test cases to allow enabling of
Libgcrypt debugging and also some minor output style changes.
There is one FIXME in the code:
/* FIXME: mpi_print creates an unsigned integer - is that intended
or should we convert it to a signed integer (2-compl)? */
mpi_print (xbuf, sizeof (xbuf), result_x);
X may be positive or negative but GCRYMPI_FMT_USG ignores the sign.
Thus this is not what we actually want. Should we change it to 2-comp
(GCRYMPI_FMT_STD) so that we have a proper value? Given that the curve
is 255 bit this should alwas fit int the 256 bit buffer. Another option
would be to use the EdDSA method for the sign but that is optimized to
easily recover x and would be more work. Or we store the sign in the
high bit. t all depends on what you want to write into the protocol
specs.
I would also like to revert the way we distinguish between Ed25519 with
and without ECDSA: The way we do it right now is by assuming the
Ed25519 is always used with EdDSA unless a flag has been set. This is a
bit surprising and requiring the "(flags eddsa)" would be a less
surprising interface.
Salam-Shalom,
Werner
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 980710b19..c65c9223a 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -194,16 +194,8 @@ struct GNUNET_CRYPTO_EcdsaSignature | |||
194 | struct GNUNET_CRYPTO_EddsaPublicKey | 194 | struct GNUNET_CRYPTO_EddsaPublicKey |
195 | { | 195 | { |
196 | /** | 196 | /** |
197 | * Q consists of an x- and a y-value, each mod p (256 bits), | 197 | * Q consists of an x- and a y-value, each mod p (256 bits), given |
198 | * given here in affine coordinates. | 198 | * here in affine coordinates and Ed25519 standard compact format. |
199 | * | ||
200 | * FIXME: this coordinate will be removed in the future (compressed point!). | ||
201 | */ | ||
202 | unsigned char q_x[256 / 8]; | ||
203 | |||
204 | /** | ||
205 | * Q consists of an x- and a y-value, each mod p (256 bits), | ||
206 | * given here in affine coordinates. | ||
207 | */ | 199 | */ |
208 | unsigned char q_y[256 / 8]; | 200 | unsigned char q_y[256 / 8]; |
209 | 201 | ||
@@ -217,16 +209,10 @@ struct GNUNET_CRYPTO_EddsaPublicKey | |||
217 | struct GNUNET_CRYPTO_EcdsaPublicKey | 209 | struct GNUNET_CRYPTO_EcdsaPublicKey |
218 | { | 210 | { |
219 | /** | 211 | /** |
220 | * Q consists of an x- and a y-value, each mod p (256 bits), | 212 | * Q consists of an x- and a y-value, each mod p (256 bits), given |
221 | * given here in affine coordinates. | 213 | * here in affine coordinates. For the Ed25519 curve we need to |
222 | * | 214 | * convey the y-value along with the sign. The compact format used |
223 | * FIXME: this coordinate will be removed in the future (compressed point!). | 215 | * is the same as with EdDSA (little endian). |
224 | */ | ||
225 | unsigned char q_x[256 / 8]; | ||
226 | |||
227 | /** | ||
228 | * Q consists of an x- and a y-value, each mod p (256 bits), | ||
229 | * given here in affine coordinates. | ||
230 | */ | 216 | */ |
231 | unsigned char q_y[256 / 8]; | 217 | unsigned char q_y[256 / 8]; |
232 | 218 | ||
@@ -250,19 +236,10 @@ struct GNUNET_PeerIdentity | |||
250 | struct GNUNET_CRYPTO_EcdhePublicKey | 236 | struct GNUNET_CRYPTO_EcdhePublicKey |
251 | { | 237 | { |
252 | /** | 238 | /** |
253 | * Q consists of an x- and a y-value, each mod p (256 bits), | 239 | * Q consists of an x- and a y-value, each mod p (256 bits), given |
254 | * given here in affine coordinates. | 240 | * here in affine coordinates and Ed25519 standard compact format. |
255 | */ | ||
256 | unsigned char q_x[256 / 8]; | ||
257 | |||
258 | /** | ||
259 | * Q consists of an x- and a y-value, each mod p (256 bits), | ||
260 | * given here in affine coordinates. | ||
261 | * | ||
262 | * FIXME: this coordinate will be removed in the future (compressed point!). | ||
263 | */ | 241 | */ |
264 | unsigned char q_y[256 / 8]; | 242 | unsigned char q_y[256 / 8]; |
265 | |||
266 | }; | 243 | }; |
267 | 244 | ||
268 | 245 | ||