This binary prints the serialized sorting context on the non-encrypted input in (serde) JSON format. Main context graph is based on [the Radix Sort MPC protocol](https://eprint.iacr.org/2019/695.pdf) implemented [here](../ciphercore_base/applications/sort/fn.create_sort_graph.html). # Arguments `n` - number of elements of an array `st` - scalar type of array elements # Usage `< this_binary > -
()
| 35 | /// |
| 36 | /// `< this_binary > -s <st> <n>` |
| 37 | fn main() { |
| 38 | // Initialize a logger that collects information about errors and panics within CipherCore. |
| 39 | // This information can be accessed via RUST_LOG. |
| 40 | env_logger::init(); |
| 41 | // Execute CipherCore code such that all the internal errors are properly formatted and logged. |
| 42 | execute_main(|| -> Result<()> { |
| 43 | let args = Args::parse(); |
| 44 | let st = ScalarType::from_str(&args.scalar_type)?; |
| 45 | // Create a context |
| 46 | let context = create_context()?; |
| 47 | // Create a sort graph in the context |
| 48 | let graph: Graph = create_sort_graph(context.clone(), args.n, st)?; |
| 49 | // Set this graph as main to be able to finalize the context |
| 50 | context.set_main_graph(graph)?; |
| 51 | // Finalize the context. This makes sure that all the graphs of the contexts are ready for computation. |
| 52 | // After this action the context can't be changed. |
| 53 | context.finalize()?; |
| 54 | // Serialize the context and print it to stdout |
| 55 | println!("{}", serde_json::to_string(&context)?); |
| 56 | Ok(()) |
| 57 | }); |
| 58 | } |
nothing calls this directly
no test coverage detected