mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 13:23:10 +00:00
wip
This commit is contained in:
parent
6070213232
commit
a00773d5aa
@ -87,7 +87,7 @@
|
||||
},
|
||||
{
|
||||
"Private": {
|
||||
"address": "6ffe0893c4b2c956fdb769b11fe4e3b2dd36ac4bd0ad90c810844051747c8c04",
|
||||
"address": "9cb6b0035320266e430eac9d96745769e7efcf30d2b9cc21ff000b3f873dc2a8",
|
||||
"account": {
|
||||
"program_owner": [
|
||||
0,
|
||||
@ -316,7 +316,7 @@
|
||||
},
|
||||
{
|
||||
"Private": {
|
||||
"address": "4ee9de60e33da96fd72929f1485fb365bcc9c1634dd44e4ba55b1ab96692674b",
|
||||
"address": "a55f4f98d2f265c91d8a9868564242d8070b9bf7180a29363f52eb76988636fd",
|
||||
"account": {
|
||||
"program_owner": [
|
||||
0,
|
||||
@ -544,4 +544,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,9 +30,9 @@ pub const ACC_SENDER: &str = "1b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c
|
||||
pub const ACC_RECEIVER: &str = "4d4b6cd1361032ca9bd2aeb9d900aa4d45d9ead80ac9423374c451a7254d0766";
|
||||
|
||||
pub const ACC_SENDER_PRIVATE: &str =
|
||||
"6ffe0893c4b2c956fdb769b11fe4e3b2dd36ac4bd0ad90c810844051747c8c04";
|
||||
"9cb6b0035320266e430eac9d96745769e7efcf30d2b9cc21ff000b3f873dc2a8";
|
||||
pub const ACC_RECEIVER_PRIVATE: &str =
|
||||
"4ee9de60e33da96fd72929f1485fb365bcc9c1634dd44e4ba55b1ab96692674b";
|
||||
"a55f4f98d2f265c91d8a9868564242d8070b9bf7180a29363f52eb76988636fd";
|
||||
|
||||
pub const TIME_TO_WAIT_FOR_BLOCK_SECONDS: u64 = 12;
|
||||
|
||||
|
||||
@ -43,14 +43,14 @@ impl KeyChain {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn produce_user_address(&self) -> [u8; 32] {
|
||||
let mut hasher = sha2::Sha256::new();
|
||||
|
||||
hasher.update(&self.nullifer_public_key);
|
||||
hasher.update(self.incoming_viewing_public_key.to_bytes());
|
||||
|
||||
<TreeHashType>::from(hasher.finalize_fixed())
|
||||
}
|
||||
// pub fn produce_user_address(&self) -> [u8; 32] {
|
||||
// let mut hasher = sha2::Sha256::new();
|
||||
//
|
||||
// hasher.update(&self.nullifer_public_key);
|
||||
// hasher.update(self.incoming_viewing_public_key.to_bytes());
|
||||
//
|
||||
// <TreeHashType>::from(hasher.finalize_fixed())
|
||||
// }
|
||||
|
||||
pub fn calculate_shared_secret_receiver(
|
||||
&self,
|
||||
|
||||
@ -22,7 +22,9 @@ impl NSSAUserData {
|
||||
) -> bool {
|
||||
let mut check_res = true;
|
||||
for (addr, key) in accounts_keys_map {
|
||||
if &nssa::Address::from(&nssa::PublicKey::new_from_private_key(key)) != addr {
|
||||
let expected_addr = nssa::Address::from(&nssa::PublicKey::new_from_private_key(key));
|
||||
if &expected_addr != addr {
|
||||
println!("{}, {}", expected_addr, addr);
|
||||
check_res = false;
|
||||
}
|
||||
}
|
||||
@ -34,7 +36,9 @@ impl NSSAUserData {
|
||||
) -> bool {
|
||||
let mut check_res = true;
|
||||
for (addr, (key, _)) in accounts_keys_map {
|
||||
if nssa::Address::new(key.produce_user_address()) != *addr {
|
||||
let expected_addr = nssa::Address::from(&key.nullifer_public_key);
|
||||
if expected_addr != *addr {
|
||||
println!("{}, {}", expected_addr, addr);
|
||||
check_res = false;
|
||||
}
|
||||
}
|
||||
@ -88,7 +92,7 @@ impl NSSAUserData {
|
||||
/// Returns the address of new account
|
||||
pub fn generate_new_privacy_preserving_transaction_key_chain(&mut self) -> nssa::Address {
|
||||
let key_chain = KeyChain::new_os_random();
|
||||
let address = nssa::Address::new(key_chain.produce_user_address());
|
||||
let address = nssa::Address::from(&key_chain.nullifer_public_key);
|
||||
|
||||
self.user_private_accounts
|
||||
.insert(address, (key_chain, nssa_core::account::Account::default()));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user