message: add bindings to verify and add some signature types
diff: @@ -6,10 +6,12 @@ use self::rcw::hmac::Hmac;
  use self::rcw::mac::Mac;
  use self::rcw::curve25519::{GeP3, ge_scalarmult_base};
  use self::rcw::ed25519::signature_extended;
  +use self::rcw::ed25519;
  pub const SEED_SIZE: usize = 32;
  pub const XPRV_SIZE: usize = 96;
  pub const XPUB_SIZE: usize = 64;
  +pub const SIGNATURE_SIZE: usize = 64;
  pub const PUBLIC_KEY_SIZE: usize = 32;
  pub const CHAIN_CODE_SIZE: usize = 32;
  @@ -17,6 +19,7 @@ pub const CHAIN_CODE_SIZE: usize = 32;
  pub type Seed = [u8; SEED_SIZE];
  pub type XPrv = [u8; XPRV_SIZE];
  pub type XPub = [u8; XPUB_SIZE];
  +pub type Signature = [u8; SIGNATURE_SIZE];
  pub type ChainCode = [u8; CHAIN_CODE_SIZE];
  @@ -242,10 +245,14 @@ pub fn derive_public(xpub: &XPub, index: DerivationIndex) -> Result<XPub, ()> {
  }
  -pub fn sign(xprv: &XPrv, message: &[u8]) -> [u8; 64] {
  +pub fn sign(xprv: &XPrv, message: &[u8]) -> Signature {
  signature_extended(message, &xprv[0..64])
  }
  +pub fn verify(xpub: &XPub, message: &[u8], signature: &Signature) -> bool {
  + ed25519::verify(message, &xpub[0..32], &signature[..])
  +}
  +
  fn mk_public_key(extended_secret: &[u8]) -> [u8; PUBLIC_KEY_SIZE] {
  assert!(extended_secret.len() == 64);
  let a = ge_scalarmult_base(&extended_secret[0..32]);
  