Skip to content

Commit e3244ae

Browse files
committed
publish solution 1.4.0
1 parent 24784fd commit e3244ae

File tree

24 files changed

+477
-536
lines changed

24 files changed

+477
-536
lines changed

bounty/src/scd.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,7 @@ fn generate_predicate_proof(
297297
template_private_key: TemplatePrivateKey,
298298
value: u64,
299299
rule_set: &mut VerificationRuleSet,
300-
) -> Result<VerifyRequest, WedprError>
301-
{
300+
) -> Result<VerifyRequest, WedprError> {
302301
user_fill_certificate_attribute(certificate_attribute_dict, value);
303302
let (
304303
sign_certificate_request,
@@ -353,8 +352,7 @@ fn issuer_make_certificate_template(
353352
fn user_fill_certificate_attribute(
354353
certificate_attribute_dict: &mut AttributeDict,
355354
attribute: u64,
356-
)
357-
{
355+
) {
358356
let mut attribute_kv = StringToStringPair::new();
359357
attribute_kv.set_key(TARGET_ATTRIBUTE.to_string());
360358
attribute_kv.set_value(attribute.to_string());
@@ -367,8 +365,7 @@ fn user_prove_rule_set(
367365
certificate_template: &CertificateTemplate,
368366
user_private_key_str: &str,
369367
rule_set: &mut VerificationRuleSet,
370-
) -> Result<VerifyRequest, WedprError>
371-
{
368+
) -> Result<VerifyRequest, WedprError> {
372369
// In most cases, this nonce should be provided by the verifier to prevent
373370
// replaying attacks.
374371
let verification_nonce_str = verifier::get_verification_nonce().unwrap();
@@ -385,7 +382,6 @@ fn user_prove_rule_set(
385382
fn verifier_verify_rule_set(
386383
rule_set: &mut VerificationRuleSet,
387384
request: &VerifyRequest,
388-
) -> bool
389-
{
385+
) -> bool {
390386
verifier::verify_selective_disclosure(&rule_set, &request).unwrap()
391387
}

bounty/src/utils.rs

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

bounty/src/vcl_data.rs

+400-400
Large diffs are not rendered by default.

ffi/ffi_c/ffi_c_ktb/src/hdk.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ pub extern "C" fn wedpr_ktb_hdk_create_mnemonic_en(
4242
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
46-
{
45+
) -> *mut c_char {
4746
let result = panic::catch_unwind(|| {
4847
let passwd = c_safe_c_char_pointer_to_string!(password_cstring);
4948
let mnemonic = c_safe_c_char_pointer_to_string!(mnemonic_cstring);
@@ -71,8 +70,7 @@ pub extern "C" fn wedpr_ktb_hdk_derive_extended_key(
7170
account: c_int,
7271
change: c_int,
7372
address_index: c_int,
74-
) -> *mut c_char
75-
{
73+
) -> *mut c_char {
7674
let result = panic::catch_unwind(|| {
7775
let master_key = c_safe_c_char_pointer_to_bytes!(master_key_cstring);
7876

ffi/ffi_c/ffi_c_scd/src/issuer.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ 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
53-
{
52+
) -> *mut c_char {
5453
let result = panic::catch_unwind(|| {
5554
let certificate_template_pb = c_safe_c_char_pointer_to_proto!(
5655
certificate_template_cstring,

ffi/ffi_c/ffi_c_scd/src/user.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ 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
26-
{
25+
) -> *mut c_char {
2726
let result = panic::catch_unwind(|| {
2827
let attribute_dict_pb = c_safe_c_char_pointer_to_proto!(
2928
attribute_dict_cstring,
@@ -67,8 +66,7 @@ pub extern "C" fn wedpr_scd_blind_certificate_signature(
6766
user_private_key_cstring: *mut c_char,
6867
certificate_secrets_blinding_factors_cstring: *mut c_char,
6968
issuer_nonce_cstring: *mut c_char,
70-
) -> *mut c_char
71-
{
69+
) -> *mut c_char {
7270
let result = panic::catch_unwind(|| {
7371
let certificate_signature_pb = c_safe_c_char_pointer_to_proto!(
7472
certificate_signature_cstring,
@@ -118,8 +116,7 @@ pub extern "C" fn wedpr_scd_prove_selective_disclosure(
118116
certificate_template_cstring: *mut c_char,
119117
user_private_key_cstring: *mut c_char,
120118
verification_nonce_cstring: *mut c_char,
121-
) -> *mut c_char
122-
{
119+
) -> *mut c_char {
123120
let result = panic::catch_unwind(|| {
124121
let certificate_signature_pb = c_safe_c_char_pointer_to_proto!(
125122
certificate_signature_cstring,

ffi/ffi_c/ffi_c_scd/src/verifier.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ 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
50-
{
49+
) -> *mut c_char {
5150
let result = panic::catch_unwind(|| {
5251
let verify_request_pb = c_safe_c_char_pointer_to_proto!(
5352
verify_request_cstring,

ffi/ffi_c/ffi_c_vcl/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wedpr_ffi_c_vcl"
3-
version = "1.3.0"
3+
version = "1.4.0"
44
authors = [ "WeDPR <wedpr@webank.com>" ]
55
edition = "2018"
66

@@ -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://gitee.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "v1.1.0" }
18+
wedpr_ffi_macros = "1.1.0"
1919
wedpr_s_protos = { path = "../../../protos"}
20-
wedpr_l_protos = { git = "https://gitee.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "v1.1.0" }
20+
wedpr_l_protos = "1.1.0"
2121
wedpr_l_macros = "1.0.0"
2222

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

ffi/ffi_c/ffi_c_vcl/src/lib.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ pub extern "C" fn wedpr_vcl_prove_sum_balance(
7575
c1_secret_cstring: *mut c_char,
7676
c2_secret_cstring: *mut c_char,
7777
c3_secret_cstring: *mut c_char,
78-
) -> *mut c_char
79-
{
78+
) -> *mut c_char {
8079
let result = panic::catch_unwind(|| {
8180
let c1_secret = decode_secret!(c_safe_c_char_pointer_to_proto!(
8281
c1_secret_cstring,
@@ -107,8 +106,7 @@ pub extern "C" fn wedpr_vcl_verify_sum_balance(
107106
c2_credit_cstring: *mut c_char,
108107
c3_credit_cstring: *mut c_char,
109108
proof_cstring: *mut c_char,
110-
) -> i8
111-
{
109+
) -> i8 {
112110
let result = panic::catch_unwind(|| {
113111
let proof = c_safe_c_char_pointer_to_proto_with_error_value!(
114112
proof_cstring,
@@ -224,8 +222,7 @@ pub extern "C" fn wedpr_vcl_prove_product_balance(
224222
c1_secret_cstring: *mut c_char,
225223
c2_secret_cstring: *mut c_char,
226224
c3_secret_cstring: *mut c_char,
227-
) -> *mut c_char
228-
{
225+
) -> *mut c_char {
229226
let result = panic::catch_unwind(|| {
230227
let c1_secret = decode_secret!(c_safe_c_char_pointer_to_proto!(
231228
c1_secret_cstring,
@@ -256,8 +253,7 @@ pub extern "C" fn wedpr_vcl_verify_product_balance(
256253
c2_credit_cstring: *mut c_char,
257254
c3_credit_cstring: *mut c_char,
258255
proof_cstring: *mut c_char,
259-
) -> i8
260-
{
256+
) -> i8 {
261257
let result = panic::catch_unwind(|| {
262258
let proof = c_safe_c_char_pointer_to_proto_with_error_value!(
263259
proof_cstring,
@@ -390,8 +386,7 @@ pub extern "C" fn wedpr_vcl_prove_range(
390386
pub extern "C" fn wedpr_vcl_verify_range(
391387
credit_cstring: *mut c_char,
392388
proof_cstring: *mut c_char,
393-
) -> i8
394-
{
389+
) -> i8 {
395390
let result = panic::catch_unwind(|| {
396391
let proof_str = c_safe_c_char_pointer_to_string_with_error_value!(
397392
proof_cstring,

ffi/ffi_java/ffi_java_ktb/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ffi_java_ktb"
3-
version = "1.3.0"
3+
version = "1.4.0"
44
authors = [ "WeDPR <wedpr@webank.com>" ]
55
edition = "2018"
66

@@ -14,8 +14,8 @@ crate-type = [ "cdylib", "staticlib" ]
1414
jni = "0.13.0"
1515
protobuf = "2.22.1"
1616
wedpr_s_hierarchical_deterministic_key = "1.3.0"
17-
wedpr_ffi_common = "1.0.0"
18-
wedpr_ffi_macros = "1.0.0"
17+
wedpr_ffi_common = "1.1.0"
18+
wedpr_ffi_macros = "1.1.0"
1919
wedpr_s_protos = "1.3.0"
2020

2121
[build-dependencies]

ffi/ffi_java/ffi_java_ktb/src/hdk.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ pub extern "system" fn Java_com_webank_wedpr_ktb_hdk_NativeInterface_createMnemo
3737
_env: JNIEnv,
3838
_class: JClass,
3939
word_count: jint,
40-
) -> jobject
41-
{
40+
) -> jobject {
4241
let result_jobject = get_result_jobject(&_env);
4342

4443
// TODO: Extract a macro for this type of function call if feasible.
@@ -67,8 +66,7 @@ pub extern "system" fn Java_com_webank_wedpr_ktb_hdk_NativeInterface_createMaste
6766
_class: JClass,
6867
password_jstring: JString,
6968
mnemonic_jstring: JString,
70-
) -> jobject
71-
{
69+
) -> jobject {
7270
let result_jobject = get_result_jobject(&_env);
7371

7472
let password =
@@ -112,8 +110,7 @@ pub extern "system" fn Java_com_webank_wedpr_ktb_hdk_NativeInterface_deriveExten
112110
account: jint,
113111
change: jint,
114112
address_index: jint,
115-
) -> jobject
116-
{
113+
) -> jobject {
117114
let result_jobject = get_result_jobject(&_env);
118115

119116
let master_key =

ffi/ffi_java/ffi_java_scd/src/issuer.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ pub extern "system" fn Java_com_webank_wedpr_scd_NativeInterface_issuerMakeCerti
3535
_env: JNIEnv,
3636
_class: JClass,
3737
schema_jstring: JString,
38-
) -> jobject
39-
{
38+
) -> jobject {
4039
let result_jobject = get_result_jobject(&_env);
4140

4241
let schema_pb = java_safe_jstring_to_pb!(
@@ -88,8 +87,7 @@ pub extern "system" fn Java_com_webank_wedpr_scd_NativeInterface_issuerSignCerti
8887
sign_request_jstring: JString,
8988
user_id_jstring: JString,
9089
user_nonce_jstring: JString,
91-
) -> jobject
92-
{
90+
) -> jobject {
9391
let result_jobject = get_result_jobject(&_env);
9492

9593
let certificate_template_pb = java_safe_jstring_to_pb!(

ffi/ffi_java/ffi_java_scd/src/user.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ pub extern "system" fn Java_com_webank_wedpr_scd_NativeInterface_userFillCertifi
3636
_class: JClass,
3737
attribute_dict_jstring: JString,
3838
certificate_template_jstring: JString,
39-
) -> jobject
40-
{
39+
) -> jobject {
4140
let result_jobject = get_result_jobject(&_env);
4241

4342
let attribute_dict_pb = java_safe_jstring_to_pb!(
@@ -110,8 +109,7 @@ pub extern "system" fn Java_com_webank_wedpr_scd_NativeInterface_userBlindCertif
110109
user_private_key_jstring: JString,
111110
certificate_secrets_blinding_factors_jstring: JString,
112111
issuer_nonce_jstring: JString,
113-
) -> jobject
114-
{
112+
) -> jobject {
115113
let result_jobject = get_result_jobject(&_env);
116114

117115
let certificate_signature_pb = java_safe_jstring_to_pb!(
@@ -190,8 +188,7 @@ pub extern "system" fn Java_com_webank_wedpr_scd_NativeInterface_userProveSelect
190188
certificate_template_jstring: JString,
191189
user_private_key_jstring: JString,
192190
verification_nonce_jstring: JString,
193-
) -> jobject
194-
{
191+
) -> jobject {
195192
let result_jobject = get_result_jobject(&_env);
196193

197194
let rule_set_pb = java_safe_jstring_to_pb!(

ffi/ffi_java/ffi_java_scd/src/verifier.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ pub extern "system" fn Java_com_webank_wedpr_scd_NativeInterface_verifierGetReve
3333
_env: JNIEnv,
3434
_class: JClass,
3535
verify_request_jstring: JString,
36-
) -> jobject
37-
{
36+
) -> jobject {
3837
let result_jobject = get_result_jobject(&_env);
3938

4039
let verify_request_pb = java_safe_jstring_to_pb!(
@@ -77,8 +76,7 @@ pub extern "system" fn Java_com_webank_wedpr_scd_NativeInterface_verifierVerifyS
7776
_class: JClass,
7877
rule_set_jstring: JString,
7978
verify_request_jstring: JString,
80-
) -> jobject
81-
{
79+
) -> jobject {
8280
let result_jobject = get_result_jobject(&_env);
8381

8482
let rule_set_pb = java_safe_jstring_to_pb!(
@@ -122,8 +120,7 @@ pub extern "system" fn Java_com_webank_wedpr_scd_NativeInterface_verifierVerifyS
122120
pub extern "system" fn Java_com_webank_wedpr_scd_NativeInterface_verifierGetVerificationNonce(
123121
_env: JNIEnv,
124122
_class: JClass,
125-
) -> jobject
126-
{
123+
) -> jobject {
127124
let result_jobject = get_result_jobject(&_env);
128125

129126
let verification_nonce =

ffi/ffi_java/ffi_java_vcl/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wedpr_ffi_java_vcl"
3-
version = "1.3.0"
3+
version = "1.4.0"
44
authors = [ "WeDPR <wedpr@webank.com>" ]
55
edition = "2018"
66

@@ -14,10 +14,10 @@ crate-type = [ "cdylib", "staticlib" ]
1414
jni = "0.13.0"
1515
protobuf = "2.22.1"
1616
wedpr_s_verifiable_confidential_ledger = { path = "../../../solution/verifiable_confidential_ledger"}
17-
wedpr_ffi_common = { git = "https://gitee.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" }
17+
wedpr_ffi_common = "1.1.0"
18+
wedpr_ffi_macros = "1.1.0"
1919
wedpr_s_protos = { path = "../../../protos"}
20-
wedpr_l_protos = { git = "https://gitee.com/WeBankBlockchain/WeDPR-Lab-Crypto.git", branch = "v1.1.0" }
20+
wedpr_l_protos = "1.1.0"
2121

2222
[build-dependencies]
2323
cbindgen = "0.9.0"

0 commit comments

Comments
 (0)