#ifndef __DSA_H__
#define __DSA_H__
#include <libecc/lib_ecc_config.h>
#include "../../hash/hash.h"
typedef struct {
nn p;
nn q;
nn g;
nn y;
} dsa_pub_key;
typedef struct {
nn p;
nn q;
nn g;
nn x;
} dsa_priv_key;
ATTRIBUTE_WARN_UNUSED_RET int dsa_import_priv_key(dsa_priv_key *priv, const u8 *p, u16 plen,
const u8 *q, u16 qlen,
const u8 *g, u16 glen,
const u8 *x, u16 xlen);
ATTRIBUTE_WARN_UNUSED_RET int dsa_import_pub_key(dsa_pub_key *pub, const u8 *p, u16 plen,
const u8 *q, u16 qlen,
const u8 *g, u16 glen,
const u8 *y, u16 ylen);
ATTRIBUTE_WARN_UNUSED_RET int dsa_compute_pub_from_priv(dsa_pub_key *pub,
const dsa_priv_key *priv);
ATTRIBUTE_WARN_UNUSED_RET int dsa_sign(const dsa_priv_key *priv, const u8 *msg, u32 msglen,
const u8 *nonce, u16 noncelen,
u8 *sig, u16 siglen, gen_hash_alg_type dsa_hash);
ATTRIBUTE_WARN_UNUSED_RET int dsa_verify(const dsa_pub_key *pub, const u8 *msg, u32 msglen,
const u8 *sig, u16 siglen, gen_hash_alg_type dsa_hash);
#endif