Skip to content

Commit 24784fd

Browse files
qyan-devHaoXuan40404
authored andcommitted
v1.4.0 refine part1
1 parent ae18283 commit 24784fd

File tree

27 files changed

+665
-402
lines changed

27 files changed

+665
-402
lines changed

bounty/src/scd.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ fn generate_predicate_proof(
297297
template_private_key: TemplatePrivateKey,
298298
value: u64,
299299
rule_set: &mut VerificationRuleSet,
300-
) -> Result<VerifyRequest, WedprError> {
300+
) -> Result<VerifyRequest, WedprError>
301+
{
301302
user_fill_certificate_attribute(certificate_attribute_dict, value);
302303
let (
303304
sign_certificate_request,
@@ -352,7 +353,8 @@ fn issuer_make_certificate_template(
352353
fn user_fill_certificate_attribute(
353354
certificate_attribute_dict: &mut AttributeDict,
354355
attribute: u64,
355-
) {
356+
)
357+
{
356358
let mut attribute_kv = StringToStringPair::new();
357359
attribute_kv.set_key(TARGET_ATTRIBUTE.to_string());
358360
attribute_kv.set_value(attribute.to_string());
@@ -365,7 +367,8 @@ fn user_prove_rule_set(
365367
certificate_template: &CertificateTemplate,
366368
user_private_key_str: &str,
367369
rule_set: &mut VerificationRuleSet,
368-
) -> Result<VerifyRequest, WedprError> {
370+
) -> Result<VerifyRequest, WedprError>
371+
{
369372
// In most cases, this nonce should be provided by the verifier to prevent
370373
// replaying attacks.
371374
let verification_nonce_str = verifier::get_verification_nonce().unwrap();
@@ -382,6 +385,7 @@ fn user_prove_rule_set(
382385
fn verifier_verify_rule_set(
383386
rule_set: &mut VerificationRuleSet,
384387
request: &VerifyRequest,
385-
) -> bool {
388+
) -> bool
389+
{
386390
verifier::verify_selective_disclosure(&rule_set, &request).unwrap()
387391
}

bounty/src/utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ pub fn print_alert5(
3434
message3: &str,
3535
message4: &str,
3636
message5: &str,
37-
) {
37+
)
38+
{
3839
println!(
3940
"{}\n{}\n{}\n{}\n{}\n",
4041
message1.yellow(),

ffi/ffi_c/ffi_c_ktb/src/hdk.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ use std::{ffi::CString, panic, ptr};
1818

1919
// Local macros and functions section.
2020

21-
/// C interface for 'wedpr_hdk_create_mnemonic_en'.
21+
/// C interface for 'wedpr_ktb_hdk_create_mnemonic_en'.
2222
#[no_mangle]
23-
pub extern "C" fn wedpr_hdk_create_mnemonic_en(
23+
pub extern "C" fn wedpr_ktb_hdk_create_mnemonic_en(
2424
word_count: c_uchar,
2525
) -> *mut c_char {
2626
let result = panic::catch_unwind(|| {
@@ -37,12 +37,13 @@ pub extern "C" fn wedpr_hdk_create_mnemonic_en(
3737
c_safe_return!(result)
3838
}
3939

40-
/// C interface for 'wedpr_hdk_create_master_key_en'.
40+
/// C interface for 'wedpr_ktb_hdk_create_master_key_en'.
4141
#[no_mangle]
42-
pub extern "C" fn wedpr_hdk_create_master_key_en(
42+
pub extern "C" fn wedpr_ktb_hdk_create_master_key_en(
4343
password_cstring: *mut c_char,
4444
mnemonic_cstring: *mut c_char,
45-
) -> *mut c_char {
45+
) -> *mut c_char
46+
{
4647
let result = panic::catch_unwind(|| {
4748
let passwd = c_safe_c_char_pointer_to_string!(password_cstring);
4849
let mnemonic = c_safe_c_char_pointer_to_string!(mnemonic_cstring);
@@ -61,16 +62,17 @@ pub extern "C" fn wedpr_hdk_create_master_key_en(
6162
c_safe_return!(result)
6263
}
6364

64-
/// C interface for 'wedpr_hdk_derive_extended_key'.
65+
/// C interface for 'wedpr_ktb_hdk_derive_extended_key'.
6566
#[no_mangle]
66-
pub extern "C" fn wedpr_hdk_derive_extended_key(
67+
pub extern "C" fn wedpr_ktb_hdk_derive_extended_key(
6768
master_key_cstring: *mut c_char,
6869
purpose_type: c_int,
6970
asset_type: c_int,
7071
account: c_int,
7172
change: c_int,
7273
address_index: c_int,
73-
) -> *mut c_char {
74+
) -> *mut c_char
75+
{
7476
let result = panic::catch_unwind(|| {
7577
let master_key = c_safe_c_char_pointer_to_bytes!(master_key_cstring);
7678

ffi/ffi_c/ffi_c_scd/src/issuer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ pub extern "C" fn wedpr_scd_sign_certificate(
4949
sign_request_cstring: *mut c_char,
5050
user_id_cstring: *mut c_char,
5151
user_nonce_cstring: *mut c_char,
52-
) -> *mut c_char {
52+
) -> *mut c_char
53+
{
5354
let result = panic::catch_unwind(|| {
5455
let certificate_template_pb = c_safe_c_char_pointer_to_proto!(
5556
certificate_template_cstring,

ffi/ffi_c/ffi_c_scd/src/user.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use wedpr_ffi_common::utils::{
2222
pub extern "C" fn wedpr_scd_fill_certificate(
2323
attribute_dict_cstring: *mut c_char,
2424
certificate_template_cstring: *mut c_char,
25-
) -> *mut c_char {
25+
) -> *mut c_char
26+
{
2627
let result = panic::catch_unwind(|| {
2728
let attribute_dict_pb = c_safe_c_char_pointer_to_proto!(
2829
attribute_dict_cstring,
@@ -66,7 +67,8 @@ pub extern "C" fn wedpr_scd_blind_certificate_signature(
6667
user_private_key_cstring: *mut c_char,
6768
certificate_secrets_blinding_factors_cstring: *mut c_char,
6869
issuer_nonce_cstring: *mut c_char,
69-
) -> *mut c_char {
70+
) -> *mut c_char
71+
{
7072
let result = panic::catch_unwind(|| {
7173
let certificate_signature_pb = c_safe_c_char_pointer_to_proto!(
7274
certificate_signature_cstring,
@@ -116,7 +118,8 @@ pub extern "C" fn wedpr_scd_prove_selective_disclosure(
116118
certificate_template_cstring: *mut c_char,
117119
user_private_key_cstring: *mut c_char,
118120
verification_nonce_cstring: *mut c_char,
119-
) -> *mut c_char {
121+
) -> *mut c_char
122+
{
120123
let result = panic::catch_unwind(|| {
121124
let certificate_signature_pb = c_safe_c_char_pointer_to_proto!(
122125
certificate_signature_cstring,

ffi/ffi_c/ffi_c_scd/src/verifier.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ pub extern "C" fn wedpr_scd_get_revealed_attributes(
4646
pub extern "C" fn wedpr_scd_verify_selective_disclosure(
4747
rule_set_cstring: *mut c_char,
4848
verify_request_cstring: *mut c_char,
49-
) -> *mut c_char {
49+
) -> *mut c_char
50+
{
5051
let result = panic::catch_unwind(|| {
5152
let verify_request_pb = c_safe_c_char_pointer_to_proto!(
5253
verify_request_cstring,

ffi/ffi_c/ffi_c_vcl/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ libc = "0.2.60"
1515
protobuf = "2.22.1"
1616
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger"}
1717
wedpr_ffi_common = "1.0.0"
18-
wedpr_ffi_macros = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "v1.1.0" }
18+
wedpr_ffi_macros = { git = "https://gitee.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "v1.1.0" }
1919
wedpr_s_protos = { path = "../../../protos"}
20-
wedpr_l_protos = { git = "https://github.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "v1.1.0" }
20+
wedpr_l_protos = { git = "https://gitee.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "v1.1.0" }
2121
wedpr_l_macros = "1.0.0"
2222

2323
# This is required to generate C/C++ header files.

0 commit comments

Comments
 (0)