fn addRegNoVal(storage: &mut key_values, phyRegNo: u32, val: u64) -> bool {
	// first check whether phyRegNo is allready saved
	for each in &storage.m_vals {
		if each.m_phyRegNo == phyRegNo {return false;}
	}

	/*ymh_log_str("ADD X\0");
	ymh_log_dec(phyRegNo as u64);
	ymh_log_hex(val);
	ymh_log_nl();*/

	let plaintext = [0, val];
	let mut ciphertext = [0 as u64; 2];
	AES_ENC(&plaintext, &mut ciphertext, &USER_KEY);

	// storage.m_vals.push(regNo_val::new(phyRegNo, val));
	storage.m_vals.push(regNo_val::new(phyRegNo, ciphertext[0], ciphertext[1]));
	true
}
// add (register number, value) to the given storage
add (register number, value) to the given storage
add ( register number value ) to the given storage
fn addRegNoVal(storage: &mut key_values, phyRegNo: u32, val: u64) -> bool {
	// first check whether phyRegNo is allready saved
	for each in &storage.m_vals {
		if each.m_phyRegNo == phyRegNo {return false;}
	}
	/*ymh_log_str("ADD X\0");
	ymh_log_dec(phyRegNo as u64);
	ymh_log_hex(val);
	ymh_log_nl();*/
	let plaintext = [0, val];
	let mut ciphertext = [0 as u64; 2];
	AES_ENC(&plaintext, &mut ciphertext, &USER_KEY);
	// storage.m_vals.push(regNo_val::new(phyRegNo, val));
	storage.m_vals.push(regNo_val::new(phyRegNo, ciphertext[0], ciphertext[1]));
	true
}
fn addRegNoVal ( storage : & mut key_values , phyRegNo : u32 , val : u64 ) -> bool { // first check whether phyRegNo is allready saved for each in & storage . m_vals { if each . m_phyRegNo == phyRegNo { return false ; } } /*ymh_log_str("ADD X\0");
	ymh_log_dec(phyRegNo as u64);
	ymh_log_hex(val);
	ymh_log_nl();*/ let plaintext = [ 0 , val ] ; let mut ciphertext = [ 0 as u64 ; 2 ] ; AES_ENC ( & plaintext , & mut ciphertext , & USER_KEY ) ; // storage.m_vals.push(regNo_val::new(phyRegNo, val)); storage . m_vals . push ( regNo_val :: new ( phyRegNo , ciphertext [ 0 ] , ciphertext [ 1 ] ) ) ; true }
add (register number, value) to the given storage
add ( register number value ) to the given storage
storage
&mut key_values
phyRegNo
u32
val
u64
storage
&mut key_values
phyRegNo
u32
val
u64