简体   繁体   English

在Java卡上使用椭圆曲线计算进行点加法

[英]Point addition using Elliptic Curve calculations on Java Card

I have a smart card which supports JavaCard 2.2.2 and I would like to develop a signature with tickets on elliptic curve. 我有一个支持JavaCard 2.2.2的智能卡,我想用椭圆曲线上的票证开发一个签名。 To do that, I need to compute the sum of 2 points on an elliptic curve. 为此,我需要计算椭圆曲线上2个点的总和。 I've read the JavaCard's API and I don't think it is possible, in fact there are things about elliptic curves but only for algorithms that are already developed (ECPrivateKey for ECDSA for example ...) But when you want to create an ECPrivateKey, you have to give the parameters which define the elliptic curve, so it is defined somewhere, right ? 我已经阅读了JavaCard的API,但我认为这是不可能的,实际上,关于椭圆曲线,有些东西只适用于已经开发的算法(例如ECDSA的ECPrivateKey ...),但是当您想创建一个ECPrivateKey,您必须提供定义椭圆曲线的参数,因此它在某处定义,对吧?

To put it in a nutshell, is it possible to develop a Java cardlet which makes computation (sum, product of points...) over an elliptic curve ? 简而言之,是否有可能开发出Java椭圆形卡,从而在椭圆曲线上进行计算(总和,点积...)?

I am a little bit lost aboutthis so thank you very much for your help :) 我对此有些迷惑,非常感谢您的帮助:)

No, it is not currently possible with the standard Java API, at least not without doing all the required computations yourself, which would require a lot of complex code and the implementation of a multiplier (which will not perform well). 不,这是目前不可能与标准的Java API,至少在没有做所有需要的计算自己,这将需要大量的复杂的代码和一个乘法器的实现(这将表现不好 )。

It may just be present in some proprietary API's though (such as certain versions of JCOP, to name a completely random example). 不过,它可能仅出现在某些专有API中(例如,某些完全相同的JCOP版本)。


Update: 3.0.5 contains ALG_EC_PACE_GM . 更新:3.0.5包含ALG_EC_PACE_GM That still not point addition, but it can be used to implement PACE without proprietary extensions. 那仍然不是重点,但是可以在没有专有扩展的情况下用于实现PACE。 If the card implements the algorithm in the first place, of course. 当然,如果卡首先实现了算法。

I'll post everything that was found based on Maarted Bodewes answer just to make things clear for further readers. 我将发布根据Maarted Bodewes答案发现的所有内容,以使更多的读者清楚知道。

  1. Yes, some proprietary JCOP API for ECC on JavaCard exists. 是的,存在一些JavaCard上用于ECC的专有JCOP API。 Example can be found here . 示例可以在这里找到。 Here is discussion about JCOP. 是关于JCOP的讨论。
  2. There is neither free tool for integrating this API to existing simulators nor native JCOP simulators available. 没有免费的工具可以将此API集成到现有模拟器中,也没有本地JCOP模拟器可用。 For free, at least. 至少是免费的。
  3. There is some API provided by Gemalto. 金雅拓提供了一些API。 At least, I've seen a piece of code that do things like that: 至少,我看过一段代码,它可以完成以下操作:

    import com.gemalto.javacard.gostservices.math.ECMathFp; ... private ECPoint point; ...

    Unfortunately, I've no further info about this Gemalto feature. 不幸的是,我没有有关此Gemalto功能的更多信息。

  4. Summing up: there is still nothing to do about ECC on javacard. 总结:javacard上的ECC仍然没有任何关系。

    If someone can share details about subject at p.3 - this would be really interesting(for me, at least) 如果有人可以在第3页分享有关主题的详细信息-这将真的很有趣(至少对我而言)

Just in case someone is still looking for a solution: 以防万一有人还在寻找解决方案:

JCMathlib realizes ECPoint addition. JCMathlib实现ECPoint添加。 You can load your curve, initialize your EC points and perform all primitive EC point operations. 您可以加载曲线,初始化EC点并执行所有原始EC点操作。

If it's for prototyping or side-channel attacks are not in your threat model, it should work nicely. 如果是用于原型开发或侧通道攻击不在您的威胁模型中,那么它应该可以正常工作。 But please note that it's unlikely that the lib will ever be as resistant to side-channel attacks as a hardware implementation. 但是请注意,该库不太可能像硬件实现一样具有抵抗旁通道攻击的能力。

Disclaimer: I'm one of the lib authors. 免责声明:我是lib的作者之一。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM