MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / main

Function main

ciphercore-base/src/bin/ciphercore_minimum.rs:36–57  ·  view source on GitHub ↗

This binary prints the serialized minimum-graph context on the non-encrypted input in (serde) JSON format. # Arguments `n` - number of elements of an array (i.e. 2 n ) `st` - scalar type of matrix elements (choose `b` for binary entries or one of Rust integer types: `i8`, `u8`, ..., `i64`, `u64`) # Usage `< this_binary > -s `

()

Source from the content-addressed store, hash-verified

34///
35/// `< this_binary > -s <st> <n>`
36fn main() {
37 // Initialize a logger that collects information about errors and panics within CipherCore.
38 // This information can be accessed via RUST_LOG.
39 env_logger::init();
40 // Execute CipherCore code such that all the internal errors are properly formatted and logged.
41 execute_main(|| -> Result<()> {
42 let args = Args::parse();
43 let st = ScalarType::from_str(&args.scalar_type)?;
44 // Create a context
45 let context = create_context()?;
46 // Create a minimum graph in the context
47 let graph: Graph = create_minimum_graph(context.clone(), args.n, st)?;
48 // Set this graph as main to be able to finalize the context
49 context.set_main_graph(graph)?;
50 // Finalize the context. This makes sure that all the graphs of the contexts are ready for computation.
51 // After this action the context can't be changed.
52 context.finalize()?;
53 // Serialize the context and print it to stdout
54 println!("{}", serde_json::to_string(&context)?);
55 Ok(())
56 });
57}

Callers

nothing calls this directly

Calls 6

execute_mainFunction · 0.85
create_minimum_graphFunction · 0.85
cloneMethod · 0.80
create_contextFunction · 0.50
set_main_graphMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected