aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-11 21:33:36 +0000
committerlloyd <[email protected]>2008-11-11 21:33:36 +0000
commitddc26f01abc6da9d06f24e8dbe3469ad8a99578e (patch)
treeb09ff02d7f1a412bf112e9bf3aad4b2e3cfbb87b
parent03e022126be8fac992a33983ac4430150fb55c84 (diff)
Add constructors to MAC_Filter taking a MAC object pointer instead of
a name.
-rw-r--r--src/filters/filters.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/filters/filters.h b/src/filters/filters.h
index 6cfbef3c0..a7e502d10 100644
--- a/src/filters/filters.h
+++ b/src/filters/filters.h
@@ -125,6 +125,37 @@ class BOTAN_DLL MAC_Filter : public Keyed_Filter
/**
* Construct a MAC filter. The MAC key will be left empty.
+ * @param mac the MAC to use
+ * @param len the output length of this filter. Leave the default
+ * value 0 if you want to use the full output of the
+ * MAC. Otherwise, specify a smaller value here so that the
+ * output of the MAC will be cut off.
+ */
+ MAC_Filter(MessageAuthenticationCode* mac_obj,
+ u32bit out_len = 0) : OUTPUT_LENGTH(out_len)
+ {
+ base_ptr = mac = mac_obj;
+ }
+
+ /**
+ * Construct a MAC filter.
+ * @param mac the MAC to use
+ * @param key the MAC key to use
+ * @param len the output length of this filter. Leave the default
+ * value 0 if you want to use the full output of the
+ * MAC. Otherwise, specify a smaller value here so that the
+ * output of the MAC will be cut off.
+ */
+ MAC_Filter(MessageAuthenticationCode* mac_obj,
+ const SymmetricKey& key,
+ u32bit out_len = 0) : OUTPUT_LENGTH(out_len)
+ {
+ base_ptr = mac = mac_obj;
+ mac->set_key(key);
+ }
+
+ /**
+ * Construct a MAC filter. The MAC key will be left empty.
* @param mac the name of the MAC to use
* @param len the output length of this filter. Leave the default
* value 0 if you want to use the full output of the