Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

OpenSSL EVP API Fix (ECB mode failing) #1997

Closed
wants to merge 8 commits into from
Prev Previous commit
Next Next commit
Whitespace fix, spaces instead of tabs.
  • Loading branch information
KiNgMaR committed Nov 29, 2011
commit ef8a73dded505145eebe4c3ebc8bbbeebab41923
16 changes: 8 additions & 8 deletions test/simple/test-crypto-ecb.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ try {

(function()
{
var encrypt = crypto.createCipheriv('BF-ECB', 'SomeRandomBlahz0c5GZVnR', '');
var hex = encrypt.update('Hello World!', 'ascii', 'hex');
hex += encrypt.final('hex');
assert.equal(hex.toUpperCase(), '6D385F424AAB0CFBF0BB86E07FFB7D71');
var encrypt = crypto.createCipheriv('BF-ECB', 'SomeRandomBlahz0c5GZVnR', '');
var hex = encrypt.update('Hello World!', 'ascii', 'hex');
hex += encrypt.final('hex');
assert.equal(hex.toUpperCase(), '6D385F424AAB0CFBF0BB86E07FFB7D71');
}());

(function()
{
var decrypt = crypto.createDecipheriv('BF-ECB', 'SomeRandomBlahz0c5GZVnR', '');
var msg = decrypt.update('6D385F424AAB0CFBF0BB86E07FFB7D71', 'hex', 'ascii');
msg += decrypt.final('ascii');
assert.equal(msg, 'Hello World!');
var decrypt = crypto.createDecipheriv('BF-ECB', 'SomeRandomBlahz0c5GZVnR', '');
var msg = decrypt.update('6D385F424AAB0CFBF0BB86E07FFB7D71', 'hex', 'ascii');
msg += decrypt.final('ascii');
assert.equal(msg, 'Hello World!');
}());