DevelopersVietNam / as3crypto

Automatically exported from code.google.com/p/as3crypto
0 stars 0 forks source link

Automatic initialization vector in IVMode class fails. #46

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The getID4e() method stores the generated iv data correctly, but the getIV4d() 
method calls the variable "iv" (which is null by default) instead of the getter 
method IV().  

This:

protected function getIV4d():ByteArray {
    var vec:ByteArray = new ByteArray;
    if (iv) {
        vec.writeBytes(iv);
    } else {
        throw new Error("an IV must be set before calling decrypt()");
    }
    return vec;
}

should be changed to:

protected function getIV4d():ByteArray {
    var vec:ByteArray = new ByteArray;
    if (IV) {
        vec.writeBytes(IV);
    } else {
        throw new Error("an IV must be set before calling decrypt()");
    }
    return vec;
}

Original issue reported on code.google.com by tobiasgo...@me.com on 4 Oct 2010 at 10:34