aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate/scan_name.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstate/scan_name.h')
-rw-r--r--src/libstate/scan_name.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/libstate/scan_name.h b/src/libstate/scan_name.h
index 9e7af40d6..ced5f3e15 100644
--- a/src/libstate/scan_name.h
+++ b/src/libstate/scan_name.h
@@ -1,6 +1,6 @@
/**
-SCAN Name Abstraction
-(C) 2008 Jack Lloyd
+* SCAN Name Abstraction
+* (C) 2008 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
@@ -35,12 +35,17 @@ class SCAN_Name
/**
@return the algorithm name
*/
- std::string algo_name() const { return name[0]; }
+ std::string algo_name() const { return alg_name; }
+
+ /**
+ @return the algorithm name plus any arguments
+ */
+ std::string algo_name_and_args() const;
/**
@return the number of arguments
*/
- u32bit arg_count() const { return name.size() - 1; }
+ u32bit arg_count() const { return args.size(); }
/**
@return if the number of arguments is between lower and upper
@@ -67,9 +72,24 @@ class SCAN_Name
@return the ith argument as a u32bit, or the default value
*/
u32bit arg_as_u32bit(u32bit i, u32bit def_value) const;
+
+ /**
+ @return the cipher mode (if any)
+ */
+ std::string cipher_mode() const
+ { return (mode_info.size() >= 1) ? mode_info[0] : ""; }
+
+ /**
+ @return the cipher mode padding (if any)
+ */
+ std::string cipher_mode_pad() const
+ { return (mode_info.size() >= 2) ? mode_info[1] : ""; }
+
private:
std::string orig_algo_spec;
- std::vector<std::string> name;
+ std::string alg_name;
+ std::vector<std::string> args;
+ std::vector<std::string> mode_info;
};
}