News for hackers. Stuff that matters.

friendlydude12

Re:Three proposals for the C standard WG14 on Thursday June 21, 2018 @09:58AM (#17365118)
I’m not saying that 1<<x is generally meaningless. I’m saying that whenever the shift operand is negative, it’s meaningless. Just like log(x) isn’t generally meaningless, it’s only meaningless when the argument is not positive.

Syntactic constructs in general should and do have meaning. The meaning isn’t inherent, but nothing has inherent meaning. log(x) has no inherent meaning, but when x is positive we have decided that it means that it evaluates to the value to which you would raise 10 to get x.

Bad run-time values only cause UB in the context of improper usage in syntactic constructs. They aren’t independent of syntactic constructs: both syntactic constructs and values dictate behavior.

You’re right that UB only manifests itself at run-time. And you’re right that we wouldn’t need to use UB for constructs that only manifest their behavior at compile-time. Indeed, there exists syntactically valid yet meaningless C++ template substitutions that don’t result in UB, they result in compilation errors.

Re:Three proposals for the C standard WG14 on Thursday June 21, 2018 @09:04AM (#17364675)
But your formulation isn’t right because it’s not about the UB code being detectable at compile-time or run-time, it’s about describing how the UB code should behave regardless of when it can be analyzed.

In the context of real numbers sqrt(-1) is syntactically valid yet meaningless code. In other contexts, 1 << -3 is too. Also log(-1). Perfectly valid syntax but has no meaning.

The intent of scare-quotes tends to be ambiguous so I avoid them in discussion. http://frivolousquotationmarks.tumblr.com

Re:Three proposals for the C standard WG14 on Thursday June 21, 2018 @07:40AM (#17364142)
It doesn’t need to be unable to be precluded at compile-time to be UB. The expression “1 << -3” can be precluded at compile-time, yet it compiles just fine: instead it invokes UB.

Doing something at runtime is a different concept from having a runtime.

In any case, C, in fact, often does have a runtime. What do you think executes main()?

Re:Three proposals for the C standard WG14 on Thursday June 21, 2018 @12:45AM (#17362232)
Undefined behavior doesn’t exist to ease portability per se, it exists to handle meaningless yet syntactically valid constructs.

Shifting by a negative number is meaningless and is indicative of programming error. Instead of specifying that an implementation should check and handle these programming errors, which implies runtime costs, we use undefined behavior and leave the responsibility to the programmer.

The reason many compilers assume a positive shift after a shift operation executes is because otherwise the entire program would be undefined. You’re effectively asking for undefined programs to have defined behavior. The equivalent would be asking the compiler to correct your typos and it can’t do that. As they say: garbage in, garbage out. The compiler isn’t the one booby trapping you, you’re booby trapping yourself.

I think GP is right that what you want is more definition but it has to be in specific cases because otherwise the runtime costs would be too high. In your negative shift example, the definition would be “shifting by a negative number results in garbage output,” but note that that would burden implementations where negative shifts trap.

Re:PicoEVB – Artix-7 FPGA board with M.2 interface on Saturday June 02, 2018 @03:07PM (#17215874)
Agreed, why not attach it to the internal USB bus? Maybe it’s a sourcing / business deal thing. I’m theorizing most laptop manufacturers have made a deal with m.2 pcie wifi producers and not the usb WiFi producers.
Inspiring story. My uncle was in prison for most of my childhood, when he got out my dad helped train him for a job in IT. It wasn’t easy since the idea of making money using a skill was so foreign to him. I can’t help but think a program like this would have ease his transition.
Re:C++17 Compiler Bug Hunt on Friday April 06, 2018 @02:59PM (#16776286)
I wish there were more technical details on kaleidoscope. Just seems like lots and lots of borderline-meaningless high-level overview.
That’s my point.
How about they all pose a serious threat to privacy?
Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @02:36PM (#16776019)
Wasn’t sure which direction he was going in but now I see. That’s incredible satire. Thumbs up.
Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @02:27PM (#16775923)
Yeah the “fake news” narrative only serves the large media corporations that want to maintain their monopoly on content. Over time more news sources, including “fake” ones, will actually improve culture and society.
Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @02:24PM (#16775891)
Yeah it’s completely untrue. There were lots of very powerful weapons available in those days that rival today’s assault weaponry (even from medieval times) and the 2nd amendment makes no mention of that.

The 2nd amendment is a principle, not a law. It’s a universal, in time and space, foundation upon which we base our laws. The Founders were well aware of this and it actually was their intention.

These were highly educated enlightenment thinkers, to assume they didn’t foresee weapon innovation is just silly.

Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @02:18PM (#16775820)
Never made that claim but thanks for the info.
Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @02:15PM (#16775788)
The first amendment isn’t intended for physical speech. It exists to protect opinions and ideas. It’s for this reason lots of non-verbal “speech” is protected under the first amendment, like online posts and flag burning.

Threatening violence or slander has nothing to do with the first amendment.

Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @02:13PM (#16775769)
And they are totally wrong because there were all sorts of machine guns and powerful cannons available in those days, even some used in the Revolutionary war.

Projectile weapons have been improving throughout history, it’s silly to assume the Founders weren’t well aware of that. I mean, there were medieval weapons that were pretty devastating by even today’s standards and the first amendment makes no mention of that. These were enlightenment thinkers well versed in the history of governments and technological progress.

The 2nd amendment is a principle meant to transcend all time and cultures. The people have a fundamental right to defend their rights.

Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @02:05PM (#16775663)
The Founders had more foresight than you think. These were enlightenment thinkers who were well versed in the history of governments and technological progress. The Bill of Rights is a document of principles: principles exist to ensure stability regardless of culture or time period or technology. The spirit of the amendment is to allow the people to spread their own information, it doesn’t matter how they do it.

The first amendment says nothing about “fake” or “real” news even though there was plenty of fake news in those days. I could argue fake news started the French Revolution.

Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @01:59PM (#16775579)
It’s not clear that throwing money at the problem will fix it. I don’t know if critical thinking is even really taught in school.
Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @01:53PM (#16775498)
Being able to physically run your mouth in public has little to do with free speech, including shouting fire in a movie theatre.

Free speech is the ability to express any opinion or idea, anti-government opinions included. This is why online posts and various non-verbal actions (like burning a flag) are protected under The First Amendment, even though nothing is being physically said. Additionally this is why threatening violence towards somebody isn’t protected: a threat of violence isn’t an opinion or an idea.

Re:Free speech cannot be sacrificed to strike fake news on Friday April 06, 2018 @01:48PM (#16775435)
The market isn’t static, it’s dynamic. The plethora of news sources will over time force consumers to think more critically about their information, since there is an inherent desire to not be a fool. The current situation is a temporary chaos before society renormalizes to the new conditions. It’s like the first few seconds of chaos when you mix red and blue water, before it settles to a calm purple.
I think a big problem with metadata-aware “file systems” is that the metadata is lost once the file is exported out of the system. This is a problem with ID3 tags for instance.

Another problem is where you make the compromise in the no-mans land between fully fledged data structure and file system. As soon as you start adding meaningful metadata to the file system, it quickly becomes apparent that you want the files themselves to be structured data and not just opaque sequences of bytes. At that point you’re redesigning the OS since that mode of usage requires user and application buy-in. It’s just a tough design problem to make any universally applicable progress in this space and it seems like any sort of non-HFS system is destined for application specific use cases.

Re:C++17 Compiler Bug Hunt on Friday April 06, 2018 @04:37AM (#16771831)
What did I just read?
Re:Fact-checking the Tor Project's government ties on Friday March 02, 2018 @11:51AM (#16503197)
Desperate for book sales.
Re:CTTK: Constant-Time Toolkit on Tuesday February 27, 2018 @08:11PM (#16479825)
The same terminology being used for distinct concepts is indeed a potential source of confusion. If you were to say “this is a constant time algorithm” I would need more information to clarify what you meant, rendering the original term less useful.
Re:CTTK: Constant-Time Toolkit on Tuesday February 27, 2018 @10:30AM (#16474181)
No. I’ve known about timing attacks for as long as I can remember. In any case, any specific individual’s familiarity with timing attacks doesn’t change the fact that using the term “constant time” to refer to time complexity is far more common than using the term to refer to timing attacks susceptibility. Not to mention formal algorithm analysis predates the formal description of timing attacks by many years. https://en.wikipedia.org/wiki/Time_complexity#Constant_time
Re:CTTK: Constant-Time Toolkit on Tuesday February 27, 2018 @04:47AM (#16472224)
There exists a constant, K, such that T(n) < K always holds true regardless of the input length. K is proportional to the length of the constant string “secret” and has no dependence on the input. Thus, matches_secret is O(1).

Furthermore, even though T(n) is bounded by a constant, it is not constant itself and its runtime is proportional to the amount of prefix characters the input has in common with the secret. This makes it not “constant time” in the crypto sense and it is susceptible to timing attacks.

The existence of a function that is constant time in the O(1) sense but not in the crypto sense proves that they are distinct concepts.

Re:CTTK: Constant-Time Toolkit on Monday February 26, 2018 @10:34PM (#16470887)
There is in fact a distinction between the two usages. I can show it with a simple counter example:

    def matches_secret(a):
        return a == “secret”
The execution time of matches_secret is bounded by a constant and the variation in execution time is correlated with secret information. This precisely means that matches_secret is constant time in the O(1) sense and not in the security sense referenced by the original article.
Re:CTTK: Constant-Time Toolkit on Monday February 26, 2018 @03:33PM (#16468731)
It also refers to time complexity: https://en.wikipedia.org/wiki/Time_complexity#Constant_time this predates the crypto jargon.
Re:CTTK: Constant-Time Toolkit on Monday February 26, 2018 @03:27PM (#16468681)
Oh really? Please explain to me how that is relevant to the point being made in this thread. https://en.wikipedia.org/wiki/Time_complexity#Constant_time
Re:Requests-HTML: HTML Parsing for Humans on Sunday February 25, 2018 @10:30PM (#16462869)
Sure, if APIs existed within a vacuum. In the real world we have to worry about ease of packaging, ease of maintenance, and various other practical costs.
Re:CTTK: Constant-Time Toolkit on Sunday February 25, 2018 @06:28PM (#16461847)
Thanks, I went to college too and was fully aware of the formal definition of O() notation. That doesn’t change the fact that colloquially it’s far more common to use the phrase “constant time” when referring to time complexity rather than timing attack resistance.

Older »