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

Async support #226

Closed
wants to merge 14 commits into from
Closed

Async support #226

wants to merge 14 commits into from

Conversation

Taowyoo
Copy link
Collaborator

@Taowyoo Taowyoo commented Mar 14, 2023

This is the successor of #163, except the commits in original PR.

Old updates Following changes are added: - Add async tests to CI

2023-03-15 update:
According to #163 (comment)
Here are some to-dos in this PR:

  • remove 'migration_mode' feature
  • Since changing 'sign' from '&mut self' to '&self' was something that was in-progress, need to either revert to '&mut self' or check that assumption is valid. Regarding this:
         pub fn sign<F: Random>(
             &self,

Following two tasks could be put in another PR&issue

  • Performance tests (compare to 0.7 under same scenario, should give similar numbers)
  • Additional unit tests / run tests with valgrind.

After this PR is merged, we could back-port it to 0.8 if needed.


Latest updates @ 2023-03-16

Notes for reviewers

Here are some explanation of implementation/changes:

  1. Aside from original Context and IoCallback, introduced new AsyncContext and IoAsyncCallback,
  2. Intoduce struct IoAdapter to wrap the tokio::net::TcpSteam with combination with the IoAsyncCallback trait to handle async functions in a synchronous context.
  3. Since, AsyncContext is a type alias for Context<IoAdapter<T>>, the PR also implemented AsyncRead & AsyncWritefor it to make it could be used as an Async IO

Key part:

  • IoAdapter implementation for IoAsyncCallback: This implementation provides the actual integration between the async I/O stream and mbedtls BIO by implementing the call_recv_async and call_send_async functions: use poll_read and poll_write of tokio::net::TcpSteam in callback

@Taowyoo Taowyoo changed the base branch from acruceru/mbedtls8-async-support to master March 14, 2023 18:40
@Taowyoo Taowyoo force-pushed the yx/mbedtls8-async-support_rebase branch from e4eb5d5 to f452beb Compare March 14, 2023 18:41
@Taowyoo

This comment was marked as off-topic.

bors bot added a commit that referenced this pull request Mar 14, 2023
@Taowyoo Taowyoo changed the title Rebase Acruceru/mbedtls8 async support onto master Rebased Acruceru/mbedtls8 async support Mar 14, 2023
@bors

This comment was marked as duplicate.

@Taowyoo Taowyoo self-assigned this Mar 15, 2023
@Taowyoo

This comment was marked as duplicate.

bors bot added a commit that referenced this pull request Mar 15, 2023
@Taowyoo

This comment was marked as abuse.

bors bot added a commit that referenced this pull request Mar 15, 2023
226: Rebased Acruceru/mbedtls8 async support r=Taowyoo a=Taowyoo

This is the successor of #163, except the commits in original PR.
Following changes are added:
- Add async tests to CI

2023-03-15 update:
According to #163 (comment)
Here are some to-dos in this PR:
- [x] remove 'migration_mode' feature
- [x] Since changing 'sign' from '&mut self' to '&self' was something that was in-progress, need to either revert to '&mut self' or check that assumption is valid. Regarding this:
	```rust
	    pub fn sign<F: Random>(
	        &self,
	```
Following two tasks could be put in another PR&issue
- Performance tests (compare to 0.7 under same scenario, should give similar numbers)
- Additional unit tests / run tests with valgrind. 





Co-authored-by: Adrian Cruceru <adrian.cruceru@fortanix.com>
Co-authored-by: Yuxiang Cao <yuxiang.cao@fortanix.com>
@Taowyoo

This comment was marked as abuse.

@bors

This comment was marked as outdated.

@Taowyoo Taowyoo force-pushed the yx/mbedtls8-async-support_rebase branch from b9f94c8 to f63b2cc Compare March 15, 2023 20:50
@bors

This comment was marked as duplicate.

@Taowyoo Taowyoo force-pushed the yx/mbedtls8-async-support_rebase branch from 9ea5265 to 2e5a225 Compare March 20, 2023 18:07
@Taowyoo Taowyoo changed the title Rebased Acruceru/mbedtls8 async support Async support Mar 20, 2023
@Taowyoo
Copy link
Collaborator Author

Taowyoo commented Mar 23, 2023

Close thie PR since latest implementation is put in a new PR: #239

@Taowyoo Taowyoo closed this Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant