Chair-for-Security-Engineering / VERICA

Other
12 stars 2 forks source link

Uniformity test fails in VERICA docker no matter what type of analysis VERICA performs or how small the design is! #1

Closed sabbaghm closed 1 year ago

sabbaghm commented 1 year ago

I am trying to run a uniformity test using VERICA in the provided ubuntu docker (also test on source compiled installation on debian), and it always produces the following error (gdb output, full_log.TXT is attached) on any netlist (including on the default VERICA example):

`AddressSanitizer: Out of memory. The process has exhausted 65536MB for size class 96.

==257383==ERROR: AddressSanitizer: allocator is out of memory trying to allocate 0x40 bytes

0 0x7ffff78b94c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95

#1 0x55555559ab56 in std::__new_allocator<std::_Rb_tree_node<std::pair<int const, std::vector<verica::Wire const*, std::allocator<verica::Wire const*> > > > >::allocate(unsigned long, void const*) /usr/include/c++/12/bits/new_allocator.h:137

==257383==HINT: if you don't care about these errors you may set allocator_may_return_null=1 SUMMARY: AddressSanitizer: out-of-memory ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95 in operator new(unsigned long) ==257383==ABORTING [Inferior 1 (process 257383) exited with code 01]

The config file is listed here for reference: { "general": { "verbose": 3, "cores": 1, "memory": 1, "netlist": { "file": "test/case-study-nina/and_snina_d1_k1.v", "name": "", "module": "" }, "library": { "file": "cell/nang45.txt", "name": "NANG45" }, "filtering": { "sca": { "type": "none", "whitelist": "model/sca-whitelist", "blacklist": "model/sca-blacklist" }, "fia": { "type": "none", "whitelist": "model/fia-whitelist", "blacklist": "model/fia-blacklist" } }, "annotation": { "file": "test/case-study-nina/annotations.json", "apply": false }, "cudd": { "reordering": true }, "visualization": { "enable": true, "path": "dot/", "full": true, "partial": true } },

"side-channel":
{
    "enable": true,
    "configuration":
    {
        "order": 2,
        "variate": 0,
        "masking": 0,
        "interrupt": true
    },
    "model":
    {
        "glitches": false,
        "transitions": false,
        "couplings": false
    },
    "analysis": 
    {
        "uniformity": true,
        "probing": false,
        "p-ni": false,
        "p-sni": false,
        "pini": false
    }
},

"fault-injection":
{
    "enable": false,
    "configuration":
    {
        "number": 1,
        "variate": 1,
        "interrupt": false
    },
    "model": 
    {
        "mapping": "model/setreset.txt",
        "location": "cs"
    },
    "analysis":
    {
        "reduced_complexity": false,
        "strategy": "detection",
        "f-ni": false,
        "f-sni": false,
        "fini": false
    }
}
"combined": 
{
    "enable": false,
    "analysis":
    {
        "c-ni": false,
        "c-sni": true,
        "ic-sni": false,
        "cini": false,
        "icini": false
    }
}

}

How we can resolve this issue and perform uniformity tests on masking countermeasures? Thank you!

jrichterb commented 1 year ago

Hi,

Thank you for your comment!

VERICA is not able to perform the uniformity check since no information about input and output shares are passed to the analysis. In order to perform a successful verification, you need to apply the annotations to the test, e.g., set general.annotation.apply to true. The annotation file contains information about the share domains, share indices, and fault domain which are required to verify the uniformity of a given design.

I hope that this will help you to perform your desired analysis. If you have any other questions, please let me know.

Cheers, Jan

jrichterb commented 1 year ago

Additionally, I noticed that there was a bug in the corresponding code that leads to the error message you reported. I fixed it and VERICA should not crash in the uniformity tests anymore. However, in order to obtain correct verification results, VERICA needs the information from the annotation file.

Thank you for reporting this issue!