IteratedS2k performance: Align initial hash input when there are prepended zeros. This reduces the execution time by approximately 7% for a typical case such as requesting 40 bytes using sha1.
IteratedS2k performance: Align initial hash input when there are prepended zeros. This reduces the execution time by approximately 7% for a typical case such as requesting 40 bytes using sha1.

Change from counting up with i to counting down with remaining. This allows us to change this line:
var size = (block_size < count) ? block_size : count;
Which isn't actually what we want, because count is how many passphrase input bytes we want.
The new line is this which seems less prone to bugs:
var size = (block_size < remaining) ? block_size : remaining;
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=71926909

dconnolly/yahoo-end-to-end,google/end-to-end,yahoo/end-to-end,google/end-to-end,atsuyim/end-to-end-1,coruus/e2e-g2y-cryptolib,google/end-to-end,koto/end-to-end-1,kaderud/end-to-end,dconnolly/google-end-to-end,diracdeltas/end-to-end-2,koto/end-to-end-1,microlv/end-to-end,digideskio/end-to-end,koto/end-to-end-1,google/end-to-end,jw0201/end-to-end,yahoo/end-to-end,diracdeltas/end-to-end-2,dconnolly/yahoo-end-to-end,diracdeltas/end-to-end-1,jprucnal/end-to-end,Yiyuan17/end-to-end,dlg-yahoo/temp,dlg-yahoo/temp,rcchan/end-to-end,yahoo/end-to-end,dconnolly/google-end-to-end,dlg-yahoo/temp,jw0201/end-to-end,kaderud/end-to-end,postfix/end-to-end,sirdarckcat/end-to-end,microlv/end-to-end,diracdeltas/end-to-end-2,chenhuang511/end-to-end,kbsriram/end-to-end,rcchan/end-to-end,digideskio/end-to-end,sirdarckcat/end-to-end,chenhuang511/end-to-end,microlv/end-to-end,rcchan/end-to-end,jw0201/end-to-end,Yiyuan17/end-to-end,postfix/end-to-end,atsuyim/end-to-end-1,dconnolly/google-end-to-end,Endika/end-to-end,sirdarckcat/end-to-end,diracdeltas/end-to-end-1,Yiyuan17/end-to-end,postfix/end-to-end,kbsriram/end-to-end,adhintz/end-to-end,diracdeltas/end-to-end-1,dconnolly/yahoo-end-to-end,dconnolly/yahoo-end-to-end,Endika/end-to-end,adhintz/end-to-end,kbsriram/end-to-end,google/end-to-end,kaderud/end-to-end,jprucnal/end-to-end,postfix/end-to-end,diracdeltas/end-to-end,digideskio/end-to-end,sirdarckcat/end-to-end,diracdeltas/end-to-end,adhintz/end-to-end,dconnolly/google-end-to-end,jw0201/end-to-end,diracdeltas/end-to-end-2,Yiyuan17/end-to-end,atsuyim/end-to-end-1,jprucnal/end-to-end,koto/end-to-end-1,01022499/end-to-end,diracdeltas/end-to-end-1,coruus/e2e-g2y-cryptolib,Endika/end-to-end,yahoo/end-to-end,Endika/end-to-end,jprucnal/end-to-end,kaderud/end-to-end,01022499/end-to-end,sirdarckcat/end-to-end,koto/end-to-end-1,adhintz/end-to-end,rcchan/end-to-end,adhintz/end-to-end,chenhuang511/end-to-end,kbsriram/end-to-end,chenhuang511/end-to-end,digideskio/end-to-end,coruus/e2e-g2y-cryptolib,diracdeltas/end-to-end,kbsriram/end-to-end,01022499/end-to-end,atsuyim/end-to-end-1,coruus/e2e-g2y-cryptolib,microlv/end-to-end,Endika/end-to-end