encryptRaw method
Implementation
Uint8List encryptRaw(
Uint8List password,
Uint8List salt,
int logRounds,
Uint32List cdata,
) {
int rounds;
int i;
int j;
var clen = cdata.length;
if ((logRounds < 4) || (logRounds > 30)) {
throw Exception('Bad number of rounds');
}
rounds = (1 << logRounds);
if (salt.length != bcryptSaltLen) {
throw Exception('Bad salt length');
}
initKey();
_ekskey(salt, password);
for ((i = 0); i != rounds; i++) {
key(password);
key(salt);
}
for ((i = 0); i < 64; i++) {
for ((j = 0); j < (clen >> 1); j++) {
encipher(cdata, j << 1);
}
}
var ret = Uint8List(clen * 4);
(i = 0);
(j = 0);
for (; i < clen; i++) {
ret[j++] = ((cdata[i] >> 24) & 0xff);
ret[j++] = ((cdata[i] >> 16) & 0xff);
ret[j++] = ((cdata[i] >> 8) & 0xff);
ret[j++] = (cdata[i] & 0xff);
}
return ret;
}