1
0
mirror of https://github.com/biergaizi/codecrypt synced 2024-06-25 00:08:20 +00:00

fmtseq: report remaining signature count

This commit is contained in:
Mirek Kratochvil 2013-04-22 12:38:27 +02:00
parent fc163535f5
commit 5e950a7a12

@ -321,12 +321,15 @@ int fmtseq::generate (pubkey&pub, privkey&priv,
*
*/
#include "ios.h"
#include "iohelpers.h"
int privkey::sign (const bvector& hash, bvector& sig, hash_func& hf)
{
if (hash.size() != hash_size() ) return 2;
if (!sigs_remaining() ) return 2;
if (!sigs_remaining() ) {
err ("fmtseq notice: no signatures left");
return 2;
}
uint commitments = fmtseq_commitments (hs);
@ -383,6 +386,9 @@ int privkey::sign (const bvector& hash, bvector& sig, hash_func& hf)
//move to the next signature and update the cache
update_privkey (*this, hf);
err ("fmtseq notice: " << sigs_remaining() << " signatures remaining");
return 0;
}