From 77346547239080389204d5d051e1f7b128cff454 Mon Sep 17 00:00:00 2001 From: Joy Wang <108701016+joyqvq@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:18:10 -0400 Subject: [PATCH] remove unused --- .../src/crypto/attestation.rs | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 sui-execution/v2/sui-move-natives/src/crypto/attestation.rs diff --git a/sui-execution/v2/sui-move-natives/src/crypto/attestation.rs b/sui-execution/v2/sui-move-natives/src/crypto/attestation.rs deleted file mode 100644 index 914edacdee8fc9..00000000000000 --- a/sui-execution/v2/sui-move-natives/src/crypto/attestation.rs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// SPDX-License-Identifier: Apache-2.0 - -use move_binary_format::errors::PartialVMResult; -use move_core_types::gas_algebra::InternalGas; -use move_vm_runtime::native_functions::NativeContext; -use move_vm_types::{ - loaded_data::runtime_types::Type, - natives::function::NativeResult, - pop_arg, - values::{Value, VectorRef}, -}; -use smallvec::smallvec; -use std::collections::VecDeque; -use sui_types::attestation::attestation_verify_inner; -pub fn nitro_attestation_verify( - _context: &mut NativeContext, - ty_args: Vec, - mut args: VecDeque, -) -> PartialVMResult { - debug_assert!(ty_args.is_empty()); - debug_assert!(args.len() == 5); - - // todo: figure out cost - - let pcr2 = pop_arg!(args, VectorRef); - let pcr1 = pop_arg!(args, VectorRef); - let pcr0 = pop_arg!(args, VectorRef); - let enclave_pk = pop_arg!(args, VectorRef); - let attestation = pop_arg!(args, VectorRef); - - let attestation_ref = attestation.as_bytes_ref(); - let enclave_pk_ref = enclave_pk.as_bytes_ref(); - let pcr0_ref = pcr0.as_bytes_ref(); - let pcr1_ref = pcr1.as_bytes_ref(); - let pcr2_ref = pcr2.as_bytes_ref(); - - if attestation_verify_inner( - &attestation_ref, - &enclave_pk_ref, - &pcr0_ref, - &pcr1_ref, - &pcr2_ref, - ) - .is_err() - { - Ok(NativeResult::ok( - InternalGas::zero(), - smallvec![Value::bool(false)], - )) - } else { - Ok(NativeResult::ok( - InternalGas::zero(), - smallvec![Value::bool(true)], - )) - } -}