isislovecruft commented on May 5, 2017 First things first: @petertodd, you've publicly, repetitively defended a man who raped me

PublicKey::from_bytes() docs could be a bit more helpful #4




 Closed
petertodd opened this issue on May 5, 2017 · 1 comment

Comments

@petertodd
It'd be helpful if there was a bit more info on how the callee is supposed to ensure that the bytes represent a valid CompressedEdwardsY, how to ensure they're a point on the curve, and what are the consequences if you don't do that.
@isislovecruft

Member

isislovecruft commented on May 5, 2017

First things first: @petertodd, you've publicly, repetitively defended a man who raped me and several other people, and disparaged the victims who were brave enough to come forward with their stories. Do not speak to me. Do not use work as an excuse to speak to me. Do not use cryptography as an excuse to speak to me.
Now, lest someone say I didn't address your "issue". Both methods are labelled with a giant Warning header, so I'm not sure I see the problem. If you do:
extern crate ed25519_dalek;
extern crate rand;
extern crate sha2;

use rand::OsRng;
use sha2::Sha512;
use ed25519_dalek::Keypair;

let mut csprng = OsRng::new().unwrap();
let keypair = Keypair::generate::(&mut csprng);
let public_key_bytes: [u8; 32] = keypair.public.to_bytes();
And then you later do:
use ed25519_dalek::PublicKey;
let public_key = PublicKey::from_bytes(public_key_bytes);
Then everything will work out fine. If you do anything else, e.g. use a hypothetical broken library¹ to generate the keys, or somehow handcraft your own artisanal broken key, then ed25519-dalek will be unable to verify signatures, because curve25519-dalek will fail to decompress the point.
¹ FWIW, I've no reason to believe there is any incompatibility between ed25519-dalek and other current implementations (and the ed25519-dalek tests call SecretKey::from_bytes() and PublicKey::from_bytes() on keys generated with another implementation).

@isislovecruft isislovecruft closed this on May 5, 2017


huitseeker added a commit to huitseeker/ed25519-dalek that referenced this issue on May 29
https://github.com/dalek-cryptography/ed25519-dalek/issues/4

Comments