In order to thank you for all members' support of our website, we are holding new events - Getting Free Samples by Paying Freight only.
Want to get free samples? Please check this post for more details.

I have a question about generateSecret

JavaCard Applet Development Related Questions and Answers.
BirdKing
Posts: 36
Joined: Wed Nov 04, 2015 7:23 am
Points :254
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: 19
Joined: Wed Jun 20, 2018 4:06 am
Points :98
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: 36
Joined: Wed Nov 04, 2015 7:23 am
Points :254
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: 27
Joined: Mon Jun 04, 2018 5:07 am
Points :190
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 4 guests

JavaCard OS : Disclaimer