This discussion is very interessting, yet i could'nt see/find a way (after trying several variants) using non-ref's in the ofb code which will top the performance of the current one.

However... 
In the meanwhile i wrote a small patch for AES/Rijndael which gives its en/decrypt() a performance-boost between 30% - 35% in all operating modes (ECB, CFB, CTR, CFB, OFB) using MODE_INTERNAL ... :-)

I'll send a pull request for this after Rijndael.php is reviewed/commited... 

The performance result will look like this:

Testcode:
```php
// AES, MODE_INTERNAL, CBC, 128-bit key, encrypt/decrypting 1MB
$aes->decrypt($aes->encrypt(str_pad('a',1024*1024))); 
```

Time using the current code:
14 sec.

Time using the new code:
10 sec.