fn measureSSection_forEval(elr: u64, sStoragePaddr_page: u64, scb: &mut SCB) {
	// let elr_paddr = memutil::userVaddr2PaddrEx(elr, false /*not a page addr*/);

	let tempAddr = memutil::tempMap(elr);
	let tempAddr2 = unsafe {STATIC_HEAP.as_ptr()};

	// do the measurement!
	// let k = unsafe {*(tempAddr as *const u32)};
	// let k = unsafe {STATIC_HEAP.as_ptr()};
	/*ymh_log_str("CODE_MEASURING_FOR_EVAL:\0");
	ymh_log_hex( tempAddr2 as u64);
	ymh_log_nl();*/
	// checkPM();
	let mut node = SS_node::new();

	/*let mut t_start: u64;
	let mut t_end: u64;
	pmEnableReset();

	unsafe { asm! ("mrs $0, pmccntr_el0" : "=r" (t_start) :: "memory"); }

	for i in 0..1000 {
		SHA1(tempAddr2 as *const u8, 4096, &mut node.m_hashCal);
	}
	unsafe { asm! ("mrs $0, pmccntr_el0" : "=r" (t_end) :: "memory"); }
	ymh_log_str("SHA1 latency (4096 bytes) avg:\0");
	ymh_log_dec( (t_end-t_start)/1000 );
	ymh_log_nl();*/
	// SHA1(tempAddr2 as *const u8, 4096, &mut node.m_hashCal);
	SHA1(tempAddr2 as *const u8, 2048, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 1024, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 512, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 256, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 128, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 64, &mut node.m_hashCal);
	// scb.m_slist.push(node);

	memutil::tempUnmap(tempAddr);
}
// Use this only for evaluation
// This does SHA1 on 4096 bytes
Use this only for evaluation
This does SHA1 on 4096 bytes
Use this only for evaluation This does SHA1 on 4096 bytes
fn measureSSection_forEval(elr: u64, sStoragePaddr_page: u64, scb: &mut SCB) {
	// let elr_paddr = memutil::userVaddr2PaddrEx(elr, false /*not a page addr*/);
	let tempAddr = memutil::tempMap(elr);
	let tempAddr2 = unsafe {STATIC_HEAP.as_ptr()};
	// do the measurement!
	// let k = unsafe {*(tempAddr as *const u32)};
	// let k = unsafe {STATIC_HEAP.as_ptr()};
	/*ymh_log_str("CODE_MEASURING_FOR_EVAL:\0");
	ymh_log_hex( tempAddr2 as u64);
	ymh_log_nl();*/
	// checkPM();
	let mut node = SS_node::new();
	/*let mut t_start: u64;
	let mut t_end: u64;
	pmEnableReset();
	unsafe { asm! ("mrs $0, pmccntr_el0" : "=r" (t_start) :: "memory"); }
	for i in 0..1000 {
		SHA1(tempAddr2 as *const u8, 4096, &mut node.m_hashCal);
	}
	unsafe { asm! ("mrs $0, pmccntr_el0" : "=r" (t_end) :: "memory"); }
	ymh_log_str("SHA1 latency (4096 bytes) avg:\0");
	ymh_log_dec( (t_end-t_start)/1000 );
	ymh_log_nl();*/
	// SHA1(tempAddr2 as *const u8, 4096, &mut node.m_hashCal);
	SHA1(tempAddr2 as *const u8, 2048, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 1024, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 512, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 256, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 128, &mut node.m_hashCal);
	// SHA1(tempAddr2 as *const u8, 64, &mut node.m_hashCal);
	// scb.m_slist.push(node);
	memutil::tempUnmap(tempAddr);
}
fn measureSSection_forEval ( elr : u64 , sStoragePaddr_page : u64 , scb : & mut SCB ) { // let elr_paddr = memutil::userVaddr2PaddrEx(elr, false /*not a page addr*/); let tempAddr = memutil :: tempMap ( elr ) ; let tempAddr2 = unsafe { STATIC_HEAP . as_ptr ( ) } ; // do the measurement! // let k = unsafe {*(tempAddr as *const u32)}; // let k = unsafe {STATIC_HEAP.as_ptr()}; /*ymh_log_str("CODE_MEASURING_FOR_EVAL:\0");
	ymh_log_hex( tempAddr2 as u64);
	ymh_log_nl();*/ // checkPM(); let mut node = SS_node :: new ( ) ; /*let mut t_start: u64;
	let mut t_end: u64;
	pmEnableReset();

	unsafe { asm! ("mrs $0, pmccntr_el0" : "=r" (t_start) :: "memory"); }

	for i in 0..1000 {
		SHA1(tempAddr2 as *const u8, 4096, &mut node.m_hashCal);
	}
	unsafe { asm! ("mrs $0, pmccntr_el0" : "=r" (t_end) :: "memory"); }
	ymh_log_str("SHA1 latency (4096 bytes) avg:\0");
	ymh_log_dec( (t_end-t_start)/1000 );
	ymh_log_nl();*/ // SHA1(tempAddr2 as *const u8, 4096, &mut node.m_hashCal); SHA1 ( tempAddr2 as * const u8 , 2048 , & mut node . m_hashCal ) ; // SHA1(tempAddr2 as *const u8, 1024, &mut node.m_hashCal); // SHA1(tempAddr2 as *const u8, 512, &mut node.m_hashCal); // SHA1(tempAddr2 as *const u8, 256, &mut node.m_hashCal); // SHA1(tempAddr2 as *const u8, 128, &mut node.m_hashCal); // SHA1(tempAddr2 as *const u8, 64, &mut node.m_hashCal); // scb.m_slist.push(node); memutil :: tempUnmap ( tempAddr ) ; }
Use this only for evaluation
This does SHA1 on 4096 bytes
Use this only for evaluation This does SHA1 on 4096 bytes
elr
u64
sStoragePaddr_page
u64
scb
&mut SCB
elr
u64
sStoragePaddr_page
u64
scb
&mut SCB