arcis 0.13.1

A standard library of types and functions for writing MPC circuits with the Arcis framework.
Documentation
//! Methods on `f32` and `f64` accepted by the arcis interpreter.
//!
//! Each float type listed here is a documentation-only unit struct shadowing
//! the primitive of the same name within this module. The associated items
//! mirror what the arcis interpreter accepts inside `#[encrypted]` code.

const STUB_MSG: &str = "arcis::std::float is documentation-only; \
    inside `#[encrypted]` code the interpreter intercepts the real method before this stub runs.";

macro_rules! supported_float {
    ($t:ident) => {
        /// Supported items on this float type inside `#[encrypted]` code.
        #[allow(non_camel_case_types)]
        #[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Default)]
        pub struct $t;

        impl $t {
            /// Returns the absolute value of `self`.
            pub fn abs(self) -> Self {
                unimplemented!("{STUB_MSG}")
            }
            /// Returns the smaller of `self` and `other`.
            pub fn min(self, other: Self) -> Self {
                unimplemented!("{STUB_MSG}")
            }
            /// Returns the larger of `self` and `other`.
            pub fn max(self, other: Self) -> Self {
                unimplemented!("{STUB_MSG}")
            }
            /// Returns `e^self`.
            pub fn exp(self) -> Self {
                unimplemented!("{STUB_MSG}")
            }
            /// Returns `2^self`.
            pub fn exp2(self) -> Self {
                unimplemented!("{STUB_MSG}")
            }
            /// Returns the natural logarithm of `self`.
            pub fn ln(self) -> Self {
                unimplemented!("{STUB_MSG}")
            }
            /// Returns the base-2 logarithm of `self`.
            pub fn log2(self) -> Self {
                unimplemented!("{STUB_MSG}")
            }
            /// Returns the square root of `self`.
            pub fn sqrt(self) -> Self {
                unimplemented!("{STUB_MSG}")
            }
        }
    };
}

supported_float!(f32);
supported_float!(f64);