         guard data.count == type(of: self).length
             else { return nil }
         
-        guard let encryptedData = UInt128(data: Data(data))
+        guard let encryptedData = UInt128(data: data)
             else { return nil }
         
         self.encryptedData = encryptedData

///
/// The Commnad is used to request the Controller to encrypt the Plaintext_Data in the command using the Key given in the command
/// and returns the Encrypted_Data to the Host.
/// The AES-128 bit block cypher is defined in NIST Publication FIPS-197 (http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf).
public struct HCILEEncryptReturn: HCICommandReturnParameter {
    
    public static let command = HCILowEnergyCommand.encrypt //0x0017
    
    public static let length: Int = 16
    
    /// 128 bit encrypted data block.
    /// The most significant octet of the Encrypted_Data corresponds to out[0] using the notation specified in FIPS 197.

    
    public var data: Data {
        
        return Data(self)
    }
}

extension HCILEEncrypt: DataConvertible {
    
    var dataLength: Int { return 32 }
    
    static func += (data: inout Data, value: HCILEEncrypt) {
        
         // no endianness because it does not represent a numerical value
        data += value.key
        data += value.plainText
    }
}

