tangle-accelerator icon indicating copy to clipboard operation
tangle-accelerator copied to clipboard

Examine MAM request size under the encryption mechanism

Open howjmay opened this issue 5 years ago • 4 comments

We have planned to build another safe channel above MAM communication. We should examine the size of the request and even the efficiency

The workflow is here

howjmay avatar Jun 09 '20 03:06 howjmay

With this golang testing program, we got a string plaintext in 8 bytes

Signature: 2e90dcea329871b646ebc5de3c0eddaa8de3b575189e38f80860ee4c840c827f07c5775ac29a5167ac51792404164774a6eeee03830170a3439dedc227e252f036f05d1790ae31a4f319ac69a21c67a5c2f7a7199bd160c364c9907ad4ba00d6c9ab90153baef3b7aec321efe38fee8ddd485cd53c30ef9d5705bc011972c7d2956e985e2e9bca11d8246cbfc0cc67953b9bc7c281a0d582f0cd01950ea927e5e2ba1b98659c726b3701e9ac65e6eed5f617599ae777f22f862633165ff828ee89db76cbcd64b70a83246a2530f298c9e6f68a4465390b3b0752879c173ed50570244c23f9b9c3bb7b8c2656196729f99a3fc91059f2b4c64eed9990702fd7be Ciphertext: 00000000000000000000000000000000b6d53547a83a9a86a7e745abca5b7ed4

Signature length: 256 bytes Ciphertext length: 32 bytes Elapsing Time: 112.044444ms

howjmay avatar Jun 09 '20 03:06 howjmay

It is about 15ms with the implementation of Noise framework

howjmay avatar Jun 09 '20 07:06 howjmay

Testing environment

processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 142 model name : Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz stepping : 12 microcode : 0xca cpu MHz : 700.017 cache size : 6144 KB physical id : 0 siblings : 8 core id : 1 cpu cores : 4 apicid : 2 initial apicid : 2 fpu : yes fpu_exception : yes cpuid level : 22 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit bogomips : 3600.00 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management:

howjmay avatar Jun 10 '20 03:06 howjmay

Time Distribution

Step Elapsing Time (generate AES key): 12.465µs Step Elapsing Time (encrypt message with AES): 10.885µs Step Elapsing Time (hash with HMAC): 18.9µs Step Elapsing Time (sign MAC): 87.106517ms Total: 87.139806ms

howjmay avatar Jun 10 '20 09:06 howjmay