Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Jul 13, 2023
1 parent 5459efa commit bb1c65e
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nucypher-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
run: pip install mypy

- name: Run mypy.stubtest
run: python -m mypy.stubtest nucypher_core
run: python -m mypy.stubtest nucypher_core --allowlist stubtest-allowlist.txt
working-directory: nucypher-core-python

trigger-wheels:
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nucypher-core-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ crate-type = ["cdylib"]
[dependencies]
pyo3 = "0.18"
nucypher-core = { path = "../nucypher-core" }
umbral-pre = { version = "0.10.0", features = ["bindings-python"], git = "https://github.com/piotr-roslaniec/rust-umbral.git", ref = "4b28a85c494e4e2640abb131460da0680a74134d" }
ferveo = { package = "ferveo-pre-release", features = ["bindings-python"], git = "https://github.com/nucypher/ferveo.git", ref = "fbb97be59d991a263233a0b876da982143b2cbf2" }
umbral-pre = { version = "0.10.0", features = ["bindings-python"], git = "https://github.com/piotr-roslaniec/rust-umbral.git", rev = "fd2e16f9304b9dab85c9a8947a61d962ff136131" }
ferveo = { package = "ferveo-pre-release", features = ["bindings-python"], git = "https://github.com/nucypher/ferveo.git", rev = "c3b749732cc2d560240f7a1043c18d10138e30e9" }
derive_more = { version = "0.99", default-features = false, features = ["from", "as_ref"] }

[build-dependencies]
Expand Down
7 changes: 7 additions & 0 deletions nucypher-core-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ This repo contains the Python bindings for the [main Rust project][nucypher-core

You will need to have `setuptools-rust` installed. Then, for development you can just do `pip install -e .` as usual.

## Development

Update `nucypher-core-python/stubtest-allowlist.txt` with:
```bash
cd umbral-pre-python
python -m mypy.stubtest nucypher_core --generate-allowlist > stubtest-allowlist.txt
```

[pypi-image]: https://img.shields.io/pypi/v/nucypher-core
[pypi-link]: https://pypi.org/project/nucypher-core/
Expand Down
7 changes: 4 additions & 3 deletions nucypher-core-python/nucypher_core/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ from .umbral import (

from .ferveo import (
FerveoPublicKey,
Ciphertext
Ciphertext,
FerveoVariant
)


Expand Down Expand Up @@ -431,7 +432,7 @@ class MetadataResponse:
@final
class ThresholdDecryptionRequest:

def __init__(self, ritual_id: int, variant: int, ciphertext: Ciphertext, conditions: Optional[Conditions],
def __init__(self, ritual_id: int, variant: FerveoVariant, ciphertext: Ciphertext, conditions: Optional[Conditions],
context: Optional[Context]):
...

Expand All @@ -441,7 +442,7 @@ class ThresholdDecryptionRequest:

context: Optional[Context]

variant: int
variant: FerveoVariant

ciphertext: Ciphertext

Expand Down
24 changes: 20 additions & 4 deletions nucypher-core-python/nucypher_core/ferveo.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Sequence, final


@final
class Keypair:
@staticmethod
Expand All @@ -24,6 +25,7 @@ class Keypair:
def public_key(self) -> FerveoPublicKey:
...


@final
class FerveoPublicKey:
@staticmethod
Expand All @@ -40,6 +42,7 @@ class FerveoPublicKey:
def serialized_size() -> int:
...


@final
class Validator:

Expand All @@ -50,6 +53,7 @@ class Validator:

public_key: FerveoPublicKey


@final
class Transcript:
@staticmethod
Expand All @@ -59,6 +63,7 @@ class Transcript:
def __bytes__(self) -> bytes:
...


@final
class DkgPublicKey:
@staticmethod
Expand All @@ -72,6 +77,7 @@ class DkgPublicKey:
def serialized_size() -> int:
...


@final
class ValidatorMessage:

Expand All @@ -85,6 +91,7 @@ class ValidatorMessage:
validator: Validator
transcript: Transcript


@final
class Dkg:

Expand All @@ -106,6 +113,7 @@ class Dkg:
def aggregate_transcripts(self, messages: Sequence[ValidatorMessage]) -> AggregatedTranscript:
...


@final
class Ciphertext:
@staticmethod
Expand All @@ -115,6 +123,7 @@ class Ciphertext:
def __bytes__(self) -> bytes:
...


@final
class DecryptionShareSimple:
@staticmethod
Expand All @@ -123,6 +132,8 @@ class DecryptionShareSimple:

def __bytes__(self) -> bytes:
...


@final
class DecryptionSharePrecomputed:
@staticmethod
Expand All @@ -132,6 +143,7 @@ class DecryptionSharePrecomputed:
def __bytes__(self) -> bytes:
...


@final
class AggregatedTranscript:

Expand Down Expand Up @@ -166,6 +178,7 @@ class AggregatedTranscript:
def __bytes__(self) -> bytes:
...


@final
class SharedSecret:

Expand All @@ -179,22 +192,25 @@ class SharedSecret:

@final
class FerveoVariant:
simple: str
precomputed: str
simple: FerveoVariant
precomputed: FerveoVariant

def __eq__(self, other: object) -> bool:
...


def encrypt(message: bytes, aad: bytes, dkg_public_key: DkgPublicKey) -> Ciphertext:
...


def combine_decryption_shares_simple(
shares: Sequence[DecryptionShareSimple],
decryption_shares: Sequence[DecryptionShareSimple],
) -> bytes:
...


def combine_decryption_shares_precomputed(
shares: Sequence[DecryptionSharePrecomputed],
decryption_shares: Sequence[DecryptionSharePrecomputed],
) -> SharedSecret:
...

Expand Down
10 changes: 5 additions & 5 deletions nucypher-core-python/nucypher_core/umbral.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Tuple, List, final
from typing import Optional, Tuple, List, final, Sequence


@final
Expand Down Expand Up @@ -124,8 +124,8 @@ class KeyFrag:
def verify(
self,
verifying_pk: PublicKey,
delegating_pk: Optional[PublicKey] = ...,
receiving_pk: Optional[PublicKey] = ...,
delegating_pk: Optional[PublicKey] = None,
receiving_pk: Optional[PublicKey] = None,
) -> VerifiedKeyFrag:
...

Expand Down Expand Up @@ -207,13 +207,13 @@ def reencrypt(capsule: Capsule, kfrag: VerifiedKeyFrag) -> VerifiedCapsuleFrag:

@final
class CurvePoint:
coordinates: Tuple[bytes, bytes]
coordinates: Optional[Tuple[bytes, bytes]]


@final
class Parameters:

def __init__(self, *args) -> None:
def __init__(self) -> None:
...

u: CurvePoint
Expand Down
4 changes: 2 additions & 2 deletions nucypher-core-python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ impl ThresholdDecryptionRequest {
#[new]
pub fn new(
ritual_id: u32,
variant: &str,
variant: FerveoVariant,
ciphertext: &Ciphertext,
conditions: Option<&Conditions>,
context: Option<&Context>,
Expand All @@ -762,7 +762,7 @@ impl ThresholdDecryptionRequest {
.map(|conditions| conditions.backend.clone())
.as_ref(),
context.map(|context| context.backend.clone()).as_ref(),
variant,
variant.into(),
),
})
}
Expand Down
1 change: 1 addition & 0 deletions nucypher-core-python/stubtest-allowlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nucypher_core.umbral.Parameters.__init__
4 changes: 2 additions & 2 deletions nucypher-core-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ crate-type = ["cdylib", "rlib"]
default = ["console_error_panic_hook"]

[dependencies]
umbral-pre = { version = "0.10.0", features = ["bindings-wasm"], git = "https://github.com/piotr-roslaniec/rust-umbral.git", ref = "4b28a85c494e4e2640abb131460da0680a74134d" }
ferveo = { package = "ferveo-pre-release", features = ["bindings-wasm"], git = "https://github.com/nucypher/ferveo.git", ref = "fbb97be59d991a263233a0b876da982143b2cbf2" }
umbral-pre = { version = "0.10.0", features = ["bindings-wasm"], git = "https://github.com/piotr-roslaniec/rust-umbral.git", rev = "fd2e16f9304b9dab85c9a8947a61d962ff136131" }
ferveo = { package = "ferveo-pre-release", features = ["bindings-wasm"], git = "https://github.com/nucypher/ferveo.git", rev = "c3b749732cc2d560240f7a1043c18d10138e30e9" }
nucypher-core = { path = "../nucypher-core" }
wasm-bindgen = "0.2.86"
js-sys = "0.3.63"
Expand Down
4 changes: 2 additions & 2 deletions nucypher-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ readme = "README.md"
categories = ["cryptography", "no-std"]

[dependencies]
umbral-pre = { version = "0.10.0", features = ["serde"], git = "https://github.com/piotr-roslaniec/rust-umbral.git", ref = "4b28a85c494e4e2640abb131460da0680a74134d" }
ferveo = { package = "ferveo-pre-release", git = "https://github.com/nucypher/ferveo.git", ref = "fbb97be59d991a263233a0b876da982143b2cbf2" }
umbral-pre = { version = "0.10.0", features = ["serde"], git = "https://github.com/piotr-roslaniec/rust-umbral.git", rev = "fd2e16f9304b9dab85c9a8947a61d962ff136131" }
ferveo = { package = "ferveo-pre-release", git = "https://github.com/nucypher/ferveo.git", rev = "c3b749732cc2d560240f7a1043c18d10138e30e9" }
serde = { version = "1", default-features = false, features = ["derive"] }
generic-array = { version = "0.14", features = ["zeroize"] }
sha3 = "0.10"
Expand Down

0 comments on commit bb1c65e

Please sign in to comment.