Commit e77753ab authored by Niels Möller's avatar Niels Möller
Browse files

Removed randomness object. Added signature and verification object.

Rev: src/abstract_crypto.h:1.5
parent 18a5be79
...@@ -78,11 +78,35 @@ struct mac_algorithm ...@@ -78,11 +78,35 @@ struct mac_algorithm
#define MAKE_MAC(m, key) ((m)->make_mac((m), (key))) #define MAKE_MAC(m, key) ((m)->make_mac((m), (key)))
struct randomness struct signer
{ {
void (*random)(struct randomness **closure, UINT32 length, UINT8 *dst); /* Returns a signature string, *without* the length field */
struct lsh_string * (*sign)(struct signer *closure,
UINT32 length,
UINT8 *data);
}; };
#define RANDOM(r, length, dst) ((r)->random(&(r), length, dst)) struct verifier
int (*verify)(struct verifier *closure,
UINT32 length,
UINT8 *data,
UINT32 signature_length,
UINT8 * signature_data);
struct signature_algorithm
struct signer *
(struct make_signer *)(struct signature_algorithm *closure,
UINT32 public_length,
UINT8 *public,
UINT32 secret_length,
UINT8 *secret);
struct verifier *
(struct make_verifier *)(struct signature_algorithm *closure,
UINT32 public_length,
UINT8 *public);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment