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

Bindings python #65

Merged
merged 39 commits into from
Nov 15, 2022
Merged

Bindings python #65

merged 39 commits into from
Nov 15, 2022

Conversation

ackRow
Copy link
Contributor

@ackRow ackRow commented Nov 9, 2022

Features

  • New python interfaces based on objects rather than functions
  • Unit tests for the python lib
  • CI: automatic building, testing and publishing

Technical choices

  • Compatibility with manylinux glibc >= 2.17 and Python >= 3.7
    Manylinux
    Abi3

Limitations

  • No build pipeline for Windows/MacOS yet

  • Doc string exported but not the functions signature

@ackRow ackRow changed the base branch from develop to feat/serialize_with_capacity November 9, 2022 12:41
Copy link
Collaborator

@tbrezot tbrezot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Some changes to be made on error conversion.

Also, you may want to implement your wrappers that way:

struct Attribute(AttributeRust);

This is less noisy then:

pub fn new(axis: &str, name: &str) -> Self {
    Self(AttributeRust::new(axis, name))
}

Copy link
Contributor

@Manuthor Manuthor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not much to review, great job! 👍

@Manuthor Manuthor merged commit 83157cb into feat/serialize_with_capacity Nov 15, 2022
@Manuthor Manuthor deleted the bindings-python branch November 15, 2022 10:41
tbrezot pushed a commit that referenced this pull request Nov 23, 2022
* new python interfaces based on objects rather than functions covering a broader range of functionalities
tbrezot pushed a commit that referenced this pull request Nov 25, 2022
* new python interfaces based on objects rather than functions covering a broader range of functionalities
tbrezot pushed a commit that referenced this pull request Nov 25, 2022
* new python interfaces based on objects rather than functions covering a broader range of functionalities
Manuthor added a commit that referenced this pull request Nov 28, 2022
* feat: add serialization benchmarks

* feat!: initialize `Serializer` with capacity

Use the new method `<impl Serializable>::length()` to initialize
the `Serializer` in `<impl Serializable>::try_to_bytes()` with the
correct capacity.

BREAKING CHANGE: do not write the size of the `ciphertext` of the
`plaintext` in the serialization of the `EncryptedHeader` and
`PlaintextHeader` respectively.

* fix: correct the serialized length

Check the length in `test_serialization()`

* fix: changelog

* fix: python interface

Serialization was broken in `encrypt()`.

* fix: use "develop" branch of CryptoCore

* Bindings python (#65)

* new python interfaces based on objects rather than functions covering a broader range of functionalities

* chore: update version to 8.0.0

* feat: describe serialization in README

* Fix/pyo3 (#72)

* fix(PyO3): force return of PyBytes instead of PyByteArray

* build(PyO3): add windows build

* build(PyO3): add python lib build for macOS

* refactor(PyO3): factor code in a macro for python keys

* refactor(PyO3): set size of key_bytes for SymmetricKey deserialization

* build(pyO3): set version for manylinux build and combine python build with ffi when possible

* fix(PyO3): change from_bytes function signature

* fix(PyO3): change back authentication_data to Vec<u8> to work with python list

* refactor(PyO3): add comments

* Fix python build (#76)

* build: set custom target_dir to solve osx python and flutter conflicts

* fix(PyO3): return metadata from decrypt like in the ffi

* refactor(PyO3): rewrite conversion to PyBytes to be more explicit

* fix(PyO3): apply review suggestions

* chore: fix typos and update README.md

* fix: revert breaking change in serialization

Co-authored-by: Hugo Rosenkranz-Costa <[email protected]>
Co-authored-by: Hugo Rosenkranz-Costa <[email protected]>
Co-authored-by: Manuthor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants