Skip to content

Commit

Permalink
Rename SdkEncode to HostFnEncode
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuajbouw committed Aug 9, 2022
1 parent fc081ef commit 55bdbe6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions engine-precompiles/src/alt_bn256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mod consts {
}

#[cfg(feature = "contract")]
trait SdkEncode {
trait HostFnEncode {
type Encoded;

fn sdk_encode(self) -> Self::Encoded;
Expand All @@ -77,7 +77,7 @@ fn concat_high_low(low: [u8; 8], high: [u8; 8]) -> [u8; consts::SCALAR_LEN] {
}

#[cfg(feature = "contract")]
impl SdkEncode for bn::Fr {
impl HostFnEncode for bn::Fr {
type Encoded = [u8; consts::SCALAR_LEN];

fn sdk_encode(self) -> Self::Encoded {
Expand All @@ -87,7 +87,7 @@ impl SdkEncode for bn::Fr {
}

#[cfg(feature = "contract")]
impl SdkEncode for bn::Fq {
impl HostFnEncode for bn::Fq {
type Encoded = [u8; consts::SCALAR_LEN];

fn sdk_encode(self) -> Self::Encoded {
Expand All @@ -97,7 +97,7 @@ impl SdkEncode for bn::Fq {
}

#[cfg(feature = "contract")]
impl SdkEncode for bn::G1 {
impl HostFnEncode for bn::G1 {
type Encoded = [u8; consts::POINT_LEN];

fn sdk_encode(self) -> Self::Encoded {
Expand All @@ -114,7 +114,7 @@ impl SdkEncode for bn::G1 {
}

#[cfg(feature = "contract")]
impl SdkEncode for bn::G2 {
impl HostFnEncode for bn::G2 {
type Encoded = [u8; consts::POINT_PAIR_LEN];

fn sdk_encode(self) -> Self::Encoded {
Expand All @@ -133,7 +133,7 @@ impl SdkEncode for bn::G2 {
)
};
let (y_real_low, y_real_high, y_imaginary_low, y_imaginary_high) = {
let y = g2.y(); // <- copied
let y = g2.y();
let (y_real, y_imaginary) = (y.real(), y.imaginary());
let [y_real_low, y_real_high] = y_real.into_u256().0;
let [y_imaginary_low, y_imaginary_high] = y_imaginary.into_u256().0;
Expand Down

0 comments on commit 55bdbe6

Please sign in to comment.