JavaCard的数学库? [英] Math library for JavaCard?

查看:113
本文介绍了JavaCard的数学库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在研究JavaCard项目(v.2.2.2),我需要使用平方根,对数等来计算值...

I'm currently working on a JavaCard project (v.2.2.2) and I need to compute values using square roots, logarithms, etc...

我知道JavaCard API中没有 Math 类,并想知道是否存在另一个提供此类操作的库?

I know that the Math class isn't available in JavaCard API and wonder if there exists another library which provides such operations ?

而且我也不能使用 double 值,但我需要。有没有办法在JavaCard API中表示 double 值并执行操作(例如log,sqrt等等)?

And also I can't use double values but I need to. Is there a way to represent a double value in the JavaCard API and perform operation (such as log, sqrt, etc..) ?

感谢任何帮助!

推荐答案

javacardx.framework.math 包,功能有限(加,减,乘(仅)。但是,物理卡经常不支持,即使支持,也可能是只有8个字节长

There is javacardx.framework.math package in JavaCard API since 2.2.2 with limited functionality (add, subtract, multiply only). However, is frequently unsupported by physical cards and even when supported, it might be only 8 bytes long.

JCAlgTest 现在还提供所有JavaCard包的结果,包括数据库中的卡支持的所有版本(包括javacardx.framework.math)。

JCAlgTest now also provides results for all JavaCard packages including all versions as supported by cards in the database (including the javacardx.framework.math).

或者,您可以考虑尝试 JCMathLib库。该库仅使用公共JC API调用来为BigInteger提供任意长度(以及ECPoint操作),并且是旧版 BigNat库。它将消耗大约1KB的RAM并且需要支持ECC的卡(如果你想使用ECPoint,对于BigInteger只需要它不需要)。实现仅部分在硬件(使用RSA和ECC协处理器)中完成,部分在软件中完成,因此对侧信道和故障诱导攻击的抵抗力较弱。

Alternatively, you may consider trying JCMathLib library. This library uses only public JC API calls to provide BigInteger with arbitrary length (as well as ECPoint operations) and is an improved version of older BigNat library. It will consume around 1KB RAM and requires card supporting ECC (if you like to use ECPoint, for BigInteger only it is not required). The implementation is done only partly in hardware (using RSA and ECC co-processors) and partly in software so is less resistant against side-channel and fault-induction attacks.

这篇关于JavaCard的数学库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆