OpenMined / sycret

Function Secret Sharing library for Python and Rust with hardware acceleration
https://openmined.github.io/sycret/
Apache License 2.0
54 stars 9 forks source link

feat: retrieve alpha from key #18

Closed danielorihuela closed 3 years ago

danielorihuela commented 3 years ago

Description

This PR creates a function to retrieve alpha from a key. It does NOT close #3 because there are more functions to add that are not listed on the issue. Related to #3.

Checklist

danielorihuela commented 3 years ago

I do not know why pytest fails @tholop. If you could give me a hint.

Edit: I already solved the problem. In commit 41cae8f6100d203f953988b07295c25d089e272c I added an expect so that when the pool already exists it panics. That was my bad, since using pytest test after using maturin to install the package it did not work. I changed it (d934c56c9494a3a05dce2dbfc9a221a34c0681c0). Now, the error is shown but the code does not panic.

tholop commented 3 years ago

I see, thanks for spotting and fixing that mistake. We don't actually care about the error in this case (if Rayon already has a global threadpool, that's fine), so I would prefer to avoid spamming stdout with the message.

I think that your first modification's goal was to remove some unused variable warnings (41cae8f). What about the following instead?

    let _ = rayon::ThreadPoolBuilder::new()
        .num_threads(n_threads)
        .build_global();
danielorihuela commented 3 years ago

Oh, I thought that I needed to use the expect function, panic function or handle the error to get rid of the warning. I am going to apply your change. As you can see I am a beginner in Rust.

tholop commented 3 years ago

Great, thanks for the fix -- and also for the feature to retrieve alpha!