 /// The `NSData` extension defines methods to compute the message digest.
 extension NSData: MessageDigestProducible {
 
-    public func digest(algorithm: Digest.Algorithm) -> Self {
-        let digest = Digest(algorithm)
+    /**
+     Produces the message digest.
+
+     - parameter algorithm: The cryptographic algorithm to use.
+
+     - returns:  the message digest.
+     */
+    public func digest(algorithm: MessageDigest.Algorithm) -> Self {
+        let digest = MessageDigest(algorithm)
         digest.update(self.bytesArray())
         let messageDigest = digest.final()
         return self.dynamicType.init(data: NSData(bytes: messageDigest, length: messageDigest.count))

}


internal protocol RawConvertable {
    #if swift(>=2.2)
    associatedtype RawValue
    #else

     If present, must be the same length as the selected algorithm's block size. This parameter is ignored if ECB mode is used or
     if a stream cipher algorithm is selected. nil by default.
     
     - returns: A newly created and initialized cipher object.
     */
    init(algorithm: Algorithm, options: Options, iv: IV? = nil) {
        self.algorithm = algorithm
