mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Add --generate-key.
This commit is contained in:
+5
-1
@@ -569,7 +569,7 @@ string V3Options::protectKeyDefaulted() {
|
||||
// Create a key with a human-readable symbol-like name.
|
||||
// This conversion drops ~2 bits of entropy out of 256, shouldn't matter.
|
||||
VHashSha256 digest (V3Os::trueRandom(32));
|
||||
m_protectKey = digest.digestSymbol();
|
||||
m_protectKey = "VL-KEY-"+digest.digestSymbol();
|
||||
}
|
||||
return m_protectKey;
|
||||
}
|
||||
@@ -858,6 +858,10 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
||||
shift;
|
||||
m_gateStmts = atoi(argv[i]);
|
||||
}
|
||||
else if (!strcmp(sw, "-generate-key")) {
|
||||
cout<<protectKeyDefaulted()<<endl;
|
||||
exit(0);
|
||||
}
|
||||
else if (!strcmp(sw, "-getenv") && (i+1)<argc) {
|
||||
shift;
|
||||
cout<<V3Options::getenvBuiltins(argv[i])<<endl;
|
||||
|
||||
Reference in New Issue
Block a user