tdutils: revert tosimple AesBlock::inc implementation
GitOrigin-RevId: 7f894bb710e32b6573603f3500c35daf0752cf02
This commit is contained in:
parent
132caf5c8f
commit
53b0a74f87
@ -78,13 +78,12 @@ struct alignas(8) AesBlock {
|
|||||||
|
|
||||||
AesBlock inc() const {
|
AesBlock inc() const {
|
||||||
AesBlock res;
|
AesBlock res;
|
||||||
res.lo = bswap64(bswap64(lo) + 1);
|
auto ptr = res.raw();
|
||||||
if (res.lo == 0) {
|
for (int i = 15; i >= 0; i--) {
|
||||||
res.hi = bswap64(bswap64(hi) + 1);
|
if (++ptr[i] != 0) {
|
||||||
} else {
|
break;
|
||||||
res.hi = hi;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user