Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

how to define total length of ECC F2M 571bits signture

Algorithm School

Moderator: UNKNwYSHSA

BirdKing
Posts: 86
Joined: Wed Nov 04, 2015 7:23 am
Points :656
Contact:

how to define total length of ECC F2M 571bits signture

Post by BirdKing » Wed Nov 04, 2015 7:30 am

Hello,
when I compute a signature of ecc f2m 571bits, I get a result. But the result's length greater than 0x80. how to define total length of ECC F2M 571bits signture?

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: how to define total length of ECC F2M 571bits signture

Post by UNKNwYSHSA » Thu Nov 05, 2015 11:23 pm

Have you tried to calculate the signature of this bits length using openssl?
sense and simplicity

BirdKing
Posts: 86
Joined: Wed Nov 04, 2015 7:23 am
Points :656
Contact:

Re: how to define total length of ECC F2M 571bits signture

Post by BirdKing » Fri Nov 06, 2015 12:22 am

UNKNwYSHSA wrote:Have you tried to calculate the signature of this bits length using openssl?

yes. I got a signature such as "30 81 94 02 ...".

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: how to define total length of ECC F2M 571bits signture

Post by UNKNwYSHSA » Fri Nov 06, 2015 2:24 am

BirdKing wrote:
UNKNwYSHSA wrote:Have you tried to calculate the signature of this bits length using openssl?

yes. I got a signature such as "30 81 94 02 ...".

Please show me all signature data bytes!
sense and simplicity

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: how to define total length of ECC F2M 571bits signture

Post by UNKNwYSHSA » Wed Nov 11, 2015 2:14 am

Here is the implement of function ECDSA_sign in openssl:

Code: Select all

int ECDSA_sign_ex(int type, const unsigned char *dgst, int dlen, unsigned char 
   *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r,
   EC_KEY *eckey)
{
   ECDSA_SIG *s;
   RAND_seed(dgst, dlen);
   s = ECDSA_do_sign_ex(dgst, dlen, kinv, r, eckey);
   if (s == NULL)
   {
      *siglen=0;
      return 0;
   }
   *siglen = i2d_ECDSA_SIG(s, &sig);
   ECDSA_SIG_free(s);
   return 1;
}

The signature data is encoded with DER format.
You can use the decode function

Code: Select all

d2i_ECDSA_SIG
to decode signature data.
Wait your message.
sense and simplicity

BirdKing
Posts: 86
Joined: Wed Nov 04, 2015 7:23 am
Points :656
Contact:

Re: how to define total length of ECC F2M 571bits signture

Post by BirdKing » Tue Nov 17, 2015 4:34 am

Thank you for your help.
I finally understood how to struct the R and S. Following the TLV, I can get the right signature.
Thank everybody.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 15 guests

JavaCard OS : Disclaimer