问题标签 [charm-crypto]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
159 浏览

python-3.x - 无法安装 charm-crypto Python 库

这是官方网站的链接和Github 存储库的链接。

我尝试了 4 种不同的安装方式:

  1. 使用终端安装

(venv) C:\Users\Admin\PycharmProjects\pythonProject>pip install charm-crypto 收集 charm-crypto 使用缓存 Charm-Crypto-0.43.tar.gz (364 kB) 警告:丢弃https://files.pythonhosted.org /packages/2b/6b/2c2abcb66f62155a60f5ecfe6936f651ecb9a115a2203c1b1d60d0e8d15e/Charm-Crypto-0.43.tar.gz#sha256=40c3b6261 03e5b7e42ecf28bc86e147250c6df199cb3a9f2f9f6568e379ecc0e (from https://pypi.org/simple/charm-crypto/ ). 从https://files.pythonhosted.org/package请求魅力加密 s/2b/6b/2c2abcb66f62155a60f5ecfe6936f651ecb9a115a2203c1b1d60d0e8d15e/Charm-Crypto-0.43.tar.gz#sha256=40c3b626103e5b7e42ecf28bc86e147250c6df199cb3a9f2f9f6568e379ecc0e ha s inconsistent version: filename has '0.43', but metadata has '0.0.0' ERROR: Could not find a version that satisfies the要求charm-crypto(来自版本:0.43)错误:没有找到charm-crypto的匹配分布

  1. 通过搜索 PyCharm 中可用的模块进行安装。

使用缓存的 Charm-Crypto-0.43.tar.gz (364 kB) 收集 charm-crypto 警告:丢弃https://files.pythonhosted.org/packages/2b/6b/2c2abcb66f62155a60f5ecfe6936f651ecb9a115a2203c1b1d60d0e8d15e/Charm-Crypto-0.43# . sha256=40c3b626103e5b7e42ecf28bc86e147250c6df199cb3a9f2f9f6568e379ecc0e(来自https://pypi.org/simple/charm-crypto/)。Requested charm-crypto from https://files.pythonhosted.org/packages/2b/6b/2c2abcb66f62155a60f5ecfe6936f651ecb9a115a2203c1b1d60d0e8d15e/Charm-Crypto-0.43.tar.gz#sha256=40c3b626103e5b7e42ecf28bc86e147250c6df199cb3a9f2f9f6568e379ecc0e版本不一致:文件名有“0.43”,但元数据有“0.0.0”错误:找不到满足要求的版本charm-crypto(来自版本:0.43)错误:没有找到charm-crypto的匹配分布

  1. 下载 .whl 文件并从命令提示符安装。

Microsoft Windows [版本 10.0.19042.928] (c) Microsoft Corporation。版权所有。C:\Users\Admin\Downloads>pip install C:\Users\Admin\Downloads\Charm_Crypto-0.43-cp27-none-macosx_10_5_x86_64.whl 错误:Charm_Crypto-0.43-cp27-none-macosx_10_5_x86_64.whl 不是支持的轮子这个平台。C:\Users\Admin\Downloads>install --upgrade pip 'install' 不是内部或外部命令、可运行程序或批处理文件。C:\Users\Admin\Downloads>pip install --upgrade pip 要求已经满足:c:\users\admin\pycharmprojects\pythonproject\venv\lib\site-packages (21.1.1) C:\Users\Admin 中的 pip \Downloads>pip install Charm_Crypto-0.43-cp27-none-macosx_10_5_x86_64.whl 错误:Charm_Crypto-0.43-cp27-none-macosx_10_5_x86_64.whl 不是该平台支持的轮子。C:\用户\管理员\下载>

有人向我指出 .whl 文件可能适用于 MacOS 而不是 Windows。

  1. 我也尝试下载 .exe 文件,但它给了我这个错误:

找不到 Python 版本 3.3/2.7,安装现在将中止。

抱歉没有包含任何图像,我没有必要的声誉。我已经在 crypto.stackexchange 中发布了这个问题,并被定向到这里。你可以在这里自己看看

在尝试解决此问题时,我将不胜感激,在此先感谢。

0 投票
1 回答
43 浏览

python - 如何在 Charm-Crypto 中对 GT 组的两个配对元素进行异或?

在 Charm Crypto 中,我想计算属于 GT 组的两个配对元素的 XOR。但是,似乎不支持 XOR 操作,但组 GT 的配对元素仅支持乘法(mul)和除法(div)操作。

由于我正在尝试实现的算法,我想计算相同的 XOR。下面基本上是我的算法在简单意义上要做的事情。

和 是两个配对元素val1val2我想计算它们之间的异或运算。

有人可以在这方面指导我吗?这个问题的解决方案是什么?

0 投票
2 回答
55 浏览

python - Charm-crypto 如何在矩阵中进行元素取幂?

我正在研究一个与 Charm jhuisi link合作的密码学课程项目。我有两个 numpy 矩阵:属于 ZR 的 V(2,3) 和属于 G1 的 M(3x2)。我想把 V 带到 G1,所以我可以对 M^V 取幂。要执行此操作,在 Charm 中我不能简单地使用 M**V,但我必须逐个元素地执行此操作。

但它给我一个错误"IndexError: index 2 is out of bounds for axis 0 with size 2"

以前用过Charm的人可以帮帮我吗?