in UProveParams/Program.cs [35:89]
static void Main(string[] args)
{
string outputPath;
if (args != null && args.Length > 1)
{
outputPath = args[0];
if (!Directory.Exists(outputPath))
{
throw new ArgumentException(outputPath + " does not exist");
}
}
else
{
outputPath = Directory.GetCurrentDirectory();
}
System.IO.StreamWriter writer = null;
try
{
foreach (Formatter.Type formatterType in formatterTypes)
{
foreach (string groupName in groupNames)
{
string outputFile = Path.Combine(outputPath, "recommendedparams_" + groupName + "_" + formatterType + ".txt");
writer = new System.IO.StreamWriter(outputFile);
Formatter formater = new Formatter(formatterType, writer);
formater.PrintText("U-Prove Recommended Parameters (" + groupName + ")");
if (groupName.StartsWith("L"))
{
SubgroupRecommendedParameters.Print(formater, groupName);
}
else
{
ECRecommendedParameters.Print(formater, groupName);
}
Console.WriteLine("recommended parameters " + groupName + " written to " + outputFile);
writer.Close();
writer = null;
}
}
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
Console.Error.WriteLine(e.StackTrace);
}
finally
{
if (writer != null)
{
writer.Close();
}
}
Console.WriteLine("completed");
Console.ReadLine();
}