aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/math.cpp
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2017-08-28 22:45:11 +0200
committerRenĂ© Korthaus <[email protected]>2018-01-04 18:18:22 +0100
commit5fb1cdfb5d7c6f854102ce33f8c7cad2a3b27153 (patch)
treea643600981c025985599c1a0ee13f1a516a9731e /src/cli/math.cpp
parent5ac3d723d1be27098bc3a18204a07a5972a0e283 (diff)
Print a command description for cli help
Diffstat (limited to 'src/cli/math.cpp')
-rw-r--r--src/cli/math.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/cli/math.cpp b/src/cli/math.cpp
index f01d9a1bd..2f3339898 100644
--- a/src/cli/math.cpp
+++ b/src/cli/math.cpp
@@ -19,6 +19,16 @@ class Modular_Inverse final : public Command
public:
Modular_Inverse() : Command("mod_inverse n mod") {}
+ std::string group() const override
+ {
+ return "numtheory";
+ }
+
+ std::string description() const override
+ {
+ return "Calculates a modular inverse";
+ }
+
void go() override
{
const Botan::BigInt n(get_arg("n"));
@@ -35,6 +45,16 @@ class Gen_Prime final : public Command
public:
Gen_Prime() : Command("gen_prime --count=1 bits") {}
+ std::string group() const override
+ {
+ return "numtheory";
+ }
+
+ std::string description() const override
+ {
+ return "Samples one or more primes";
+ }
+
void go() override
{
const size_t bits = get_arg_sz("bits");
@@ -55,6 +75,16 @@ class Is_Prime final : public Command
public:
Is_Prime() : Command("is_prime --prob=56 n") {}
+ std::string group() const override
+ {
+ return "numtheory";
+ }
+
+ std::string description() const override
+ {
+ return "Test if the integer n is composite or prime";
+ }
+
void go() override
{
Botan::BigInt n(get_arg("n"));
@@ -76,6 +106,16 @@ class Factor final : public Command
public:
Factor() : Command("factor n") {}
+ std::string group() const override
+ {
+ return "numtheory";
+ }
+
+ std::string description() const override
+ {
+ return "Factor a given integer";
+ }
+
void go() override
{
Botan::BigInt n(get_arg("n"));