Re:Proving that Android’s, Java’s and Python’s sorting algor...
by thaumasiotes on Tuesday February 24, 2015 @06:50PM
(#9104370)
> What you also don't seem to realize is that this attack merely uses a comparison function to find the worst case. Once the worst case is found you can feed this input to any program using libc++'s std::sort, without comparison function, and trigger the worst case.
This is true iff pivots are selected deterministically. In which case, why did you post it as a response to "how can an adversary force quadratic behavior when pivots are chosen randomly?"
Re:Proving that Android’s, Java’s and Python’s sorting algor...
by tveita on Tuesday February 24, 2015 @12:12PM
(#9101955)
> This is a bug, because the C++ standard mandates a worst case of O(n log n).
Specifically, this is a requirement in C++11. Earlier C++ standards only require it to be average-case O(n log n).
What you also don't seem to realize is that this attack merely uses a comparison function to find the worst case. Once the worst case is found you can feed this input to any program using libc++'s std::sort, without comparison function, and trigger the worst case.
So no, this is not frivolous at all.