Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

70 fix code scanning alert the pycrypto library and its module keccak are no longer actively maintained and have been deprec #71

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@

| Version | Supported |
| ------- | --------- |
| > 1.0.0 | ✅ |
| > 0.8.1 | ✅ |
| > 1.3.0 | ✅ |
| 0.8.x | ❌ |
| 0.7.x | ❌ |
| 0.6.x | ❌ |
| 0.5.x | ❌ |
| 0.4.x | ❌ |
| < 0.4.x | ❌ |

## Reporting a Feature
## Reporting a Vulnerability (v1.3.0)

- [x] The pyCrypto library and its module keccak are no longer actively maintained and have been deprecated.

## Break change (v1.0.0)

- [x] support `merkletreejs`

## Reporting a Vulnerability
## Reporting a Vulnerability (v0.8.1)

- [x] pysha3 has deprecated, update to 0.8.1

Expand Down
6 changes: 2 additions & 4 deletions merkly/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from typing import Callable, List, Tuple
from Crypto.Hash import keccak as cryptodome_keccak
import keccaky
import types


Expand Down Expand Up @@ -44,10 +44,8 @@ def keccak(data: bytes) -> bytes:
```
"""

keccak_256 = cryptodome_keccak.new(digest_bits=256)
keccak_256.update(data)
return keccaky.hash_it_bytes(data)

return keccak_256.digest()


def half(list_item: List[int]) -> Tuple[int, int]:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "merkly"
version = "1.2.0"
version = "1.3.0"
description = "🌳 The simple and easy implementation of Merkle Tree"
authors = ["Lucas Oliveira <[email protected]>"]
repository = "https://github.com/olivmath/merkly.git"
Expand Down Expand Up @@ -33,6 +33,7 @@ classifiers = [
pycryptodome = "^3.19.0"
pydantic = "^2.9.2"
python = "^3.8"
keccaky = "^0.3.1"

[tool.poetry.dev-dependencies]
conventional-pre-commit = "^3.0.0"
Expand Down
8 changes: 8 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
> [!WARNING]
> For run tests you need install javascript deps!


> [!NOTE]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note test

[no-undefined-references] Found reference to undefined definition

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when shortcut reference links are used. Note test

[no-shortcut-reference-link] Use the trailing [] on reference links
> To run just unit tests

```bash
pytest -m "not benchmark and not merkletreejs" -vv
```
Loading