Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlowFish encrypt issue #8

Open
skliarovartem opened this issue Aug 22, 2016 · 2 comments
Open

BlowFish encrypt issue #8

skliarovartem opened this issue Aug 22, 2016 · 2 comments

Comments

@skliarovartem
Copy link

skliarovartem commented Aug 22, 2016

in encrypt method we need to encrypt all blocks, so:
public function encrypt(block:ByteArray, index:Int32 = 0):Void {
var count:Int = block.length >>> 3;
var i:Int = 0;
for (i in 0...count)
encryptBlock(block, 8 * i, block, 8 * i);
}

@skliarovartem
Copy link
Author

same for decrypt:
public function decrypt(block:ByteArray, index:Int32 = 0):Void {
var count:Int = block.length >>> 3;
var i:Int = 0;

    for (i in 0...count)
        decryptBlock(block, 8 * i, block, 8 * i);
}

@soywiz
Copy link
Collaborator

soywiz commented Aug 22, 2016

Please, do a PR so I can merge it. You should remove index argument then.
Also create a test here that checks the right behaviour:
https://github.com/soywiz/haxe-crypto/blob/master/test/com/hurlant/tests/crypto/symmetric/BlowFishKeyTest.hx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants