You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let iv = rust_derive_iv_from_seed(seed.as_mut_ptr(),64);
391
+
let iv = unsafe{ slice::from_raw_parts_mut((*iv).data,16)};
392
+
let iv_len = 16;
393
+
let pt = rust_aes256_cbc_decrypt(data, password, iv.as_mut_ptr(), iv_len asu32);
394
+
assert!(!pt.is_null());
395
+
let ct_vec = unsafe{(*pt).data};
396
+
let value = recover_c_char(ct_vec);
397
+
assert_eq!(value,"hello world");
398
+
}
399
+
400
+
#[test]
401
+
fntest_dep_aes256(){
402
+
letmut data = b"hello world";
403
+
let seed = hex::decode("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").unwrap();
404
+
let iv_path = "m/44'/1557192335'/0'/2'/0'".to_string();
405
+
let iv = get_private_key_by_seed(&seed,&iv_path).unwrap();
406
+
letmut iv_bytes = [0;16];
407
+
iv_bytes.copy_from_slice(&iv[..16]);
408
+
let key = sha256(b"password");
409
+
let iv = GenericArray::from_slice(&iv_bytes);
410
+
let key = GenericArray::from_slice(&key);
411
+
412
+
let encrypter = Aes256CbcEnc::new(key, iv);
413
+
let decrypter = Aes256CbcDec::new(key, iv);
414
+
415
+
let ct = encrypter.encrypt_padded_vec_mut::<Pkcs7>(data);
416
+
let pt = decrypter.decrypt_padded_vec_mut::<Pkcs7>(&ct).unwrap();
for (inti=0; i<NUMBER_OF_ARRAYS(g_chainTable); i++) {
616
-
// slip39 wallet does not support ADA
617
-
if (isSlip39&& (g_chainTable[i].cryptoKey==BIP32_ED25519||g_chainTable[i].cryptoKey==LEDGER_BITBOX02)) {
622
+
// slip39 wallet does not support:
623
+
// ADA
624
+
// Zcash
625
+
if (isSlip39&& (g_chainTable[i].cryptoKey==BIP32_ED25519||g_chainTable[i].cryptoKey==LEDGER_BITBOX02||g_chainTable[i].cryptoKey==ZCASH_UFVK_ENCRYPTED)) {
618
626
continue;
619
627
}
620
-
// do not generate public keys for ton wallet;
628
+
// do not generate public keys for ton-only wallet;
621
629
if (g_chainTable[i].cryptoKey==TON_CHECKSUM||g_chainTable[i].cryptoKey==TON_NATIVE) {
0 commit comments