Christmas is coming soon! To thank for the support from all our dear customers, Christmas promotional activity is going on in JavaCardOS online store. For more activities details, please check this post.

I have a question about generateSecret

JavaCard Applet Development Related Questions and Answers.
BirdKing
Posts: 55
Joined: Wed Nov 04, 2015 7:23 am
Points :418
Contact:

I have a question about generateSecret

Post by BirdKing » Wed Sep 12, 2018 6:29 am

Hello,
I have a question about KeyAgreement.generateSecret.

In API specification, It descript the Throws of KeyAgreement.generateSecret as:

• CryptoException.ILLEGAL_VALUE if the publicData data format is incorrect, or if the
publicData data is inconsistent with the PrivateKey specified during initialization.
• CryptoException.INVALID_INIT if this KeyAgreement object is not initialized.

The result of generateSecret is a point. And the point maybe point-at-infinity. Or the algorithm ends in projective zero point during this operation.

My question is: Whether I should check the result point is on the curve when the API implemented?

happy123654
Posts: 35
Joined: Wed Jun 20, 2018 4:06 am
Points :216
Contact:

Re: I have a question about generateSecret

Post by happy123654 » Thu Sep 13, 2018 10:13 pm

I think you should check it.

BirdKing
Posts: 55
Joined: Wed Nov 04, 2015 7:23 am
Points :418
Contact:

Re: I have a question about generateSecret

Post by BirdKing » Fri Sep 14, 2018 6:15 am

Thanks for your answer. I think you are right. Ther error result may belong "the publicData data is inconsistent with the PrivateKey specified during initialization" .

DaHuFa
Posts: 37
Joined: Mon Jun 04, 2018 5:07 am
Points :264
Contact:

Re: I have a question about generateSecret

Post by DaHuFa » Sat Sep 15, 2018 10:58 pm

I don't think so.
The "inconsistent" may mean "the public point " not on the curve of the private key. If the result is point-at-infinity, the return value may be 0. After all, the return is "byte length of secret".
All these are my conjectures. I hope it will help you.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 2 guests

JavaCard OS : Disclaimer