semvec/pypi-packages huggingface dataset:
cpython-near-wasm-opt 0.8.13
CPython-NEAR WASM optimizer tool
Requires Python: >=3.9

CPython-NEAR WASM optimizer tool

Allows packaging arbitray Python modules together with the contract source files into a self-contained WASM file ready for
running on the NEAR blockchain.

Inputs:
  python.wasm -- pre-compiled CPython-NEAR WASM
  python-stdlib.zip -- pre-compiled CPython-NEAR stdlib .pyc files
  lib/ -- directory with contract source files and arbitrary Python modules to package into the WASM file
  
Optimizations:
  Optimizer runs the supplied contract with default arguments (or ones specified via @near.optimizer_inputs() decorator) and traces
  which Python modules and WASM functions get loaded/called during the runtime, removing unreferenced ones according to the 
  optimization settings specified via -Ox, --module-tracing=1/0, --function-tracing=off/safe/aggressive cmdline arguments.
  
  --function-tracing=safe (-O2 and lower) tries to only remove WASM functions which belong to non-referenced builtin Python modules, 
  which is safer than --function-tracing=aggressive (-O3 and higher), which removes all unreferenced WASM functions except those pinned 
  via DEFAULT_PINNED_FUNCTIONS or --pinned-functions=<name1>,<name2>,...
  
  Optimized out WASM functions are replaced with a panic handler, which will, in case such a function has still been called during 
  the contract runtime, print a message including the missing function name, which then can be added to the pinned function name list
  to ensure it is retained.
  
  Additionally, LZ4 compression can be applied to WASM data initializer, which allows up to 500KiB WASM size reduction while consuming
  ~20Tgas for decompression.
  
  Typical WASM sizes after optimization with json module included (-O4/3/2): 530/560/1363KiB.
mp-scrape-cli 0.1.8
MP Scrape -- MP Explore
Requires Python: >=3.11

<!--
SPDX-FileCopyrightText: 2025 Free Software Foundation Europe e.V. <mp-explore@fsfe.org>

SPDX-License-Identifier: AGPL-3.0-or-later
-->

# MP Scrape CLI

> MP Scrape has been renamed to MP Explore.
> Replace all references from mp-scrape* to mp-explore*
> 
> Thank you for your understanding

https://git.fsfe.org/mp-explore
nnea 0.1.1
A biological inform neural network
Requires Python: >=3.6

### Install package
```shell
pip install nnea
```

### Clone the repository
```shell
git clone git@github.com:liuchuwei/nnea.git
```

### Load Immunotherapy Dataset

```shell
mkdir datsaets
mkdir factory
mkdir factory/tumor_immunotherapy
cd factory/tumor_immunotherapy
wget --referer="https://figshare.com/" \
--user-agent="Mozilla/5.0" \
-c "https://figshare.com/ndownloader/files/56402492" -O exp.txt
wget --referer="https://figshare.com/" \
--user-agent="Mozilla/5.0" \
-c "https://figshare.com/ndownloader/files/56402489" -O phe.txt 
python run.py dataload --config config/generate_dataset.toml
```

### Generate Dataset
```shell
dataload --config config/generate_dataset.toml
```
### Train model
```shell
train --config config/tumor_imm.toml
```
qumulator 0.1.0
A client for submitting calculation tasks and polling results
Requires Python: >=3.7

# DMRG Task Client

A Python client for submitting calculation tasks to a server and polling results.

## Installation

```bash
pip install qumulator
```

## Usage Example

```python
from entropec_quantumoperator_test import DMRGClient

# Initialize client with server URL
client = DMRGClient(api_base="http://192.168.124.22:12805")

def main():
    # 初始化客户端
    client = DMRGClient(
        api_base="http://192.168.124.22:12805",  # 服务地址
        timeout=1000,  # 超时时间（秒）
        retry_interval=5  # 结果轮询间隔（秒）
    )

    # 任务参数
    task_id = "test_task_001"  # 使用唯一实例ID
    program = " vmps1FM"  # 选择调用的程序
    # program = "measureSC"  # 选择调用的程序
    params = {
        "CaseParams": {
            "Geometry": "OBC",
            "Lx": 3,
            "Ly": 4,
            "t": 1.0,
            "t2": -0.2,
            "J": 3.0,
            "J2": 1.0,
            "phi": 0.1,
            "mu": 0,
            "NumHole": 2,
            "Sweeps": 5,
            "Dmin": 10,
            "Dmax": 10,
            "CutOff": 1e-9,
            "LanczErr": 1e-9,
            "MaxLanczIter": 70,
            "Threads": 2,
            "noise": [0.1, 0.01],
            "Perturbation": 0.0,
            "BondSingletPairPerturbation": 0.0,
            "wavelength": 4
        }
    }


    try:
        # 提交任务
        print("提交测试任务...")
        response = client.submit_job(task_id, program, params)
        print(f"提交响应: {response}")

        # 获取结果（限制重试次数，避免无限等待）
        print("获取测试结果...")
        result = client.fetch_result(task_id, max_retries=5)
        print(f"测试结果: {result}")  # 打印部分结果

    except Exception as e:
        print(f"测试失败: {str(e)}")


if __name__ == "__main__":
    main()
```

## API Reference

### DMRGClient

#### `__init__(api_base, timeout=10, retry_interval=5)`
Initialize a new DMRG client.

- `api_base`: Base URL of the DMRG server
- `timeout`: Request timeout in seconds (default: 10)
- `retry_interval`: Interval between result polling attempts (default: 5)

#### `submit_job(task_id, program, params)`
Submit a DMRG calculation task.

- `task_id`: Unique identifier for the task
- `program`: The program to execute (e.g., "vmps1FM" or "measureSC")
- `params`: Dictionary containing calculation parameters
- Returns: Server response JSON

#### `fetch_result(task_id, max_retries=None)`
Poll for calculation results.

- `task_id`: Task identifier to fetch results for
- `max_retries`: Maximum number of retries (None for infinite)
- Returns: Calculation result text

## License
MIT License
giga-auto 0.3.39
giga auto test common package
Requires Python: >=3.7

# giga_auto

cd existing_repo
git remote add origin https://git2.oristand.com/qa/other/giga_auto.git
git branch -M main
git push -uf origin main
```

CMD:
 python setup.py sdist bdist_wheel
 twine upload dist/*
cryptanalysis_tools 0.1.4
sm crypto or more, cryptanalysis tools, toys
Requires Python: >=3.12

> :warning: **警告**
>
> 本项目仅作个人学习使用，不可用于生产环境，否则后果自负。
>
> This library is only for learning purposes and can ```not``` be used in ```production``` environments. Otherwise, you will be at your own risk.

> :memo: **可参考 tests 中的使用方法**

# Crypto
## SM2
### sign
> **SM2的裸签名，类似ECC，直接用这个签名不符合国标要求，除非自己特意构造的**
> **data即e，没有预处理计算ZA操作，没有SM3，因为在底下的sm2_sm3中有，**
```python
sign(self, data: bytes, private_key: int, k: int | None = None)
```

### verify
```python
verify(self, signature: asn1str | Tuple[int, int], data: bytes, public_key: Tuple[int, int])
```

### compute_ZA
```python
compute_ZA(self, public_key: Tuple[int, int], ID: str | None = None)
```

### sign_with_sm3
> **符合国标的签名**
> **SM2真正的签名对象如下**
> **tobesign = sm3.hash(ZA + data)， ZA = compute_ZA(public_key, ID)**
```python
sign_with_sm3(self, data: bytes, private_key: int, public_key: Tuple[int, int], ID: str | None = None, randomk: int | None = None)
```

### verify_with_sm3
```python
verify_with_sm3(self, signature: asn1str | Tuple[int, int], data: bytes, public_key: Tuple[int, int], ID: str | None = None)
```

### encrypt
```python
encrypt(self, msg: bytes, public_key: Tuple[int, int], k: int | None = None)
```

### decrypt
```python
decrypt(self, cipher_txt: asn1str, private_key: int)
```

### recover_privateKey_by_kAndrs
> **已知秘密随机数k，一组r，s（即签名值）,可恢复sm2私钥。**
```python
recover_privateKey_by_kAndrs(self, k: int, r: int, s: int)
```

### recover_privateKey_by_fixedk_and_2rs
> **无需知道k的具体值，但知道k是固定值，通过两组rs（即签名值），可恢复sm2私钥。**
```python
recover_privateKey_by_fixedk_and_2rs(self, r1: int, s1: int, r2: int, s2: int)
```

### recover_publicKeys_by_eAndrs
> **纯数学公式计算，知道一组签名值rs与e的值，可恢复公钥，满足条件的公钥可能存在多个。e可能是原消息m，或者是经过hash预处理的e，具体看怎么签的名**
```python
recover_publicKeys_by_eAndrs(self, e: int, r: int, s: int)
```

### is_same_k
```python
is_same_k(self, r1, e1, r2, e2)
```

### recover_private_key_by_liner_k
> **如果k的随机性是线性的，k2 = ak1 + bG，且知道线性参数，可通过两组rs，恢复sm2私钥，故固定k是一种特殊情况**
```python
recover_private_key_by_liner_k(self, r1: int, s1: int, r2: int, s2: int, a: int, b: int)
```

### forge_e_signature
> **纯数学公式计算，t是 r + s，伪造e的签名，说是伪造其实是恢复e而已，已知一组签名值rs及公钥，计算对哪个e进行签名。故可以随机产生一组r，s，然后计算得到一个e，使得验签通过**
```python
forge_e_signature(self, public_key: Tuple[int, int], s: int, t: int)
```

## SM3
### hash
> **sm3的hash方法，有点想把str输入移除了**
```python
hash(msg: bytes | str) -> bytes
```

## SM4
> **纯SM4算法加解密实现，不涉及工作模式，所以不存在IV与Padding值**
> **分组密码自身只能加密长度等于密码分组长度的单块数据**
### encrypt
```python
encrypt(plaintext: bytes, key: bytes) -> bytes
```

### decrypt
```python
decrypt(cipher: bytes, key: bytes) -> bytes
```

## utils
### kdf
> **密钥派生函数**

### rotl
> **将x循环左移n位**
```python
rotl(x, n)
```

### types
```python
asn1str: TypeAlias = str
```

# TODO :dart:
- [ ] sm2协同签名
- [ ] CBC-MAC不定长攻击
- [ ] 对称密码逆序流程
- [x] M-D 结构 hash 长度拓展攻击
- [ ] padding oracle 填充攻击
- [ ] hash collision 哈希碰撞