add methods to decrypt return data from router
[GitHub/Stricted/speedport-hybrid-php-api.git] / CryptLib / Key / Derivation / AbstractDerivation.php
diff --git a/CryptLib/Key/Derivation/AbstractDerivation.php b/CryptLib/Key/Derivation/AbstractDerivation.php
new file mode 100644 (file)
index 0000000..775a082
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+/**
+ * An abstract implementation of some standard key derivation needs
+ *
+ * PHP version 5.3
+ *
+ * @category   PHPCryptLib
+ * @package    Key
+ * @subpackage Derivation
+ * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
+ * @copyright  2011 The Authors
+ * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
+ * @version    Build @@version@@
+ */
+
+namespace CryptLib\Key\Derivation;
+
+/**
+ * An abstract implementation of some standard key derivation needs
+ *
+ * @category   PHPCryptLib
+ * @package    Key
+ * @subpackage Derivation
+ * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
+ */
+abstract class AbstractDerivation {
+
+    /**
+     * @var Hash A hashing algorithm to use for the derivation
+     */
+    protected $hash = null;
+
+    /**
+     * @var array An array of options for the key derivation function
+     */
+    protected $options = array(
+        'hash'        => 'sha512',
+    );
+
+    /**
+     * Construct the derivation instance
+     *
+     * @param array $options An array of options to set for this instance
+     *
+     * @return void
+     */
+    public function __construct(array $options = array()) {
+        $this->options = $options + $this->options;
+        $this->hash    = $this->options['hash'];
+    }
+
+}