Skip to content
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
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
with:
project-name: cloudproof_rust
toolchain: stable
kms-version: 4.5.0
kms-version: feat-edit_policy
findex-cloud-version: 0.1.0
branch-java: develop
branch-js: v9.2.0
branch-flutter: develop
branch-python: v4.1.0
branch-java: feat/edit_policy
branch-js: feat/edit_policy
branch-flutter: feat/edit_policy
branch-python: feat/edit_policy
secrets: inherit
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ members = [
resolver = "1"

[workspace.dependencies]
async-trait = "0.1.73"
base64 = "0.21.4"
async-trait = "0.1.74"
base64 = "0.21.5"
cosmian_crypto_core = "9.3.0"
cosmian_ffi_utils = "0.1.2"
hex = "0.4.3"
Expand All @@ -26,7 +26,7 @@ tracing = "0.1"
tracing-log = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-tree = "0.2"
wasm-bindgen = "0.2.87"
wasm-bindgen = "0.2.88"

[profile.release]
lto = true
Expand Down
2 changes: 1 addition & 1 deletion crates/aesgcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ pyo3 = { workspace = true, optional = true }
wasm-bindgen = { workspace = true, optional = true }

[dev-dependencies]
wasm-bindgen-test = "0.3.37"
wasm-bindgen-test = "0.3.38"
4 changes: 2 additions & 2 deletions crates/anonymization/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cosmian_crypto_core = { workspace = true }
hex = { workspace = true }
rand = { workspace = true }
rand_distr = "0.4"
regex = "1.9"
regex = "1.10"
sha2 = "0.10"
tiny-keccak = { version = "2.0.2", features = ["sha3"] }

Expand All @@ -40,4 +40,4 @@ wasm-bindgen = { workspace = true, optional = true }

[dev-dependencies]
approx = "0.5.1"
wasm-bindgen-test = "0.3.37"
wasm-bindgen-test = "0.3.38"
5 changes: 1 addition & 4 deletions crates/anonymization/src/core/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ impl Hasher {
}
hasher.update(data);
// Convert hash output to a fixed size array
let output = hasher
.finalize()
.try_into()
.expect("Sha256 hash should be 32 bytes long.");
let output = hasher.finalize().into();

Ok(output)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cloudproof/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ffi = [
######
cloudproof_aesgcm = { version = "0.1.2", optional = true }
cloudproof_anonymization = { version = "0.1.1", optional = true }
cloudproof_cover_crypt = { version = "12.0.3", optional = true }
cloudproof_cover_crypt = { path = "../cover_crypt", optional = true }
cloudproof_ecies = { version = "0.1.2", optional = true }
cloudproof_findex = { version = "5.0.4", optional = true }
cloudproof_fpe = { version = "0.2.1", optional = true }
8 changes: 4 additions & 4 deletions crates/cover_crypt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ python = ["pyo3"]
wasm_bindgen = ["js-sys", "wasm-bindgen"]

[dependencies]
cosmian_cover_crypt = { version = "12.0.3", features = ["serialization"] }
cosmian_cover_crypt = { version = "13.0.0", features = ["serialization"] }
cosmian_crypto_core = { workspace = true }
serde_json = "1.0.107"
serde_json = "1.0.108"

# Optional dependencies
cosmian_ffi_utils = { workspace = true, optional = true }
Expand All @@ -30,5 +30,5 @@ pyo3 = { workspace = true, features = ["extension-module"], optional = true }
wasm-bindgen = { workspace = true, optional = true }

[dev-dependencies]
cosmian_cover_crypt = { version = "12.0.3", features = ["test_utils"] }
wasm-bindgen-test = "0.3.37"
cosmian_cover_crypt = { version = "13.0.0", features = ["test_utils"] }
wasm-bindgen-test = "0.3.38"
67 changes: 44 additions & 23 deletions crates/cover_crypt/python/cloudproof_cover_crypt/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,59 @@ class PolicyAxis:
class Policy:
"""A policy is a set of policy axes. A fixed number of attribute creations
(revocations + additions) is allowed.

Args:
max_attribute_creations (int): number of attribute creations allowed. Defaults to 2**32 - 1
"""

def __init__(self, max_attribute_creations: int = 2**32 - 1): ...
def __init__(self): ...
def add_axis(self, axis: PolicyAxis) -> None:
"""Adds the given policy axis to the policy.

Args:
axis (PolicyAxis)
"""
def remove_axis(self, axis_name: str) -> None:
"""Removes the given axis from the policy.
Fails if there is no such axis in the policy.

Args:
axis_name (str)
"""
def add_attribute(self, attribute: Attribute, is_hybridized: bool) -> None:
"""Adds the given attribute to the policy.
Fails if the axis of the attribute does not exist in the policy.

Args:
attribute (Attribute): The name and axis of the new attribute.
is_hybridized (bool): Whether to use post quantum keys for this attribute
"""
def remove_attribute(self, attribute: Attribute) -> None:
"""Removes the given attribute from the policy.
Encrypting and decrypting for this attribute will no longer be possible once the keys are updated.

Args:
attribute (Attribute)
"""
def disable_attribute(self, attribute: Attribute) -> None:
"""Marks an attribute as read only.
The corresponding attribute key will be removed from the public key.
But the decryption key will be kept to allow reading old ciphertext.

Args:
attribute (Attribute)
"""
def rename_attribute(self, attribute: Attribute, new_name: str) -> None:
"""Changes the name of an attribute.

Args:
attribute (Attribute)
"""
def rotate(self, attribute: Attribute) -> None:
"""Rotates an attribute, changing its underlying value with an unused value.
"""Rotates an attribute, changing its underlying value with a new value.

Args:
attribute (Attribute)
"""
def clear_old_attribute_values(self, attribute: Attribute) -> None:
"""Removes old attribute values of an attribute

Args:
attribute (Attribute)
Expand Down Expand Up @@ -171,12 +210,6 @@ class MasterSecretKey:
Returns:
bytes
"""
def deep_copy(self) -> MasterSecretKey:
"""Clones the key.

Returns:
MasterSecretKey
"""
@staticmethod
def from_bytes(key_bytes: bytes) -> MasterSecretKey:
"""Reads key from bytes.
Expand All @@ -195,12 +228,6 @@ class MasterPublicKey:
Returns:
bytes
"""
def deep_copy(self) -> MasterPublicKey:
"""Clones the key.

Returns:
MasterPublicKey
"""
@staticmethod
def from_bytes(key_bytes: bytes) -> MasterPublicKey:
"""Reads key from bytes.
Expand All @@ -219,12 +246,6 @@ class UserSecretKey:
Returns:
bytes
"""
def deep_copy(self) -> UserSecretKey:
"""Clones the key.

Returns:
UserSecretKey
"""
@staticmethod
def from_bytes(key_bytes: bytes) -> UserSecretKey:
"""Reads key from bytes.
Expand Down
Loading