aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate/scan_name.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-10-13 16:01:57 +0000
committerlloyd <[email protected]>2009-10-13 16:01:57 +0000
commit9268a0455a07d31a66364aa5b7594bd75250b466 (patch)
tree63b683ca95448ce083981d002d870a569c2c98a1 /src/libstate/scan_name.h
parent3bc2bb0461b1b40466821daf0061eab769621eab (diff)
parent5318b944acc2a5fa6d445784c710f37c793ff90b (diff)
propagate from branch 'net.randombit.botan.1_8' (head c5ae189464f6ef16e3ce73ea7c563412460d76a3)
to branch 'net.randombit.botan' (head e2b95b6ad31c7539cf9ac0ebddb1d80bf63b5b21)
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;
};
}