473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Quirk in Konqueror 5 core JS ?

Greetings. This problem arises in the context of the CPAN module
Crypt::Tea ... It works with IE, Mozilla, Netscape, Firefox, IE
and Opera, but if you check out http://www.pjb.com.au/comp/test.html
using Konqueror 5.0 (at least on linux) you will find:

tea_code((2048299521,595110280),
(-764348263,554905533,637549562,-283747546))
returns 1614127572, 339082849,
should be -451692928, 1589210186,

tea_decode((2048299521,595110280),
(-764348263,554905533,637549562,-283747546))
returns 2022045126, -1848224228,
should be -257148566, -1681954940,

:-( Now these two functions are quite short, similar and simple:

function tea_code (v, k) {
// TEA. 2-int (64-bit) cyphertext block in v. 4-int (128-bit) key in k.
var v0 = v[0]; var v1 = v[1];
var k0 = k[0]; var k1 = k[1]; var k2 = k[2]; var k3 = k[3];
var sum = 0; var n = 32;
while (n-- > 0) {
sum -= 1640531527; // TEA magic number 0x9e3779b9
sum = sum|0; // force it back to 32-bit int
v0 += ((v1<<4)+k0) ^ (v1+sum) ^ ((v1>>>5)+k1) ;
v1 += ((v0<<4)+k2) ^ (v0+sum) ^ ((v0>>>5)+k3) ;
}
var w = new Array(); w[0] = v0|0; w[1] = v1|0; return w;
}
function tea_decode (v, k) {
// TEA. 2-int (64-bit) cyphertext block in v. 4-int (128-bit) key in k.
var v0 = v[0]; var v1 = v[1];
var k0 = k[0]; var k1 = k[1]; var k2 = k[2]; var k3 = k[3];
var sum = 0; var n = 32;
sum = -957401312 ; // TEA magic number 0x9e3779b9<<5
while (n-- > 0) {
v1 -= ((v0<<4)+k2) ^ (v0+sum) ^ ((v0>>>5)+k3) ;
v0 -= ((v1<<4)+k0) ^ (v1+sum) ^ ((v1>>>5)+k1) ;
sum += 1640531527; // TEA magic number 0x9e3779b9 ;
sum = sum|0; // force it back to 32-bit int
}
var w = new Array(); w[0] = v0|0; w[1] = v1|0; return w;
}

Is there perhaps some known quirk in Konqueror's handling
of core operators like << >>> | or ^ ?

Regards, Peter

--

Peter Billam, DPIWE/ILS/CIT/Servers, hbt/lnd/l8, 6233 3061
Jul 23 '05 #1
1 1469
In article <sl******************@pjb.dpiwe.tas.gov.au>, Peter Billam wrote:
Greetings. This problem arises in the context of the CPAN module
Crypt::Tea ... It works with IE, Mozilla, Netscape, Firefox, IE
and Opera, but if you check out http://www.pjb.com.au/comp/test.html
using Konqueror 5.0 (at least on linux) you will find:
...
Is there perhaps some known quirk in Konqueror's handling
of core operators like << >>> | or ^ ?

The only difference I've been able to find is revealed by

document.write('First, x = 16405315271<BR>x&gt;&gt;&gt;5 = ');
var x = 16405315271;
document.write(x>>>5);
document.write('<BR>x&gt;&gt;5 = ');
document.write(x>>5);
document.write('<BR>Second, x = 0 | 16405315271<BR>x&gt;&gt;&gt;5 = ');
x = 0 | 16405315271;
document.write(x>>>5);
document.write('<BR>x&gt;&gt;5 = ');
document.write(x>>5);

which in Firefox gives
First, x = 16405315271 (more than 32 bits!)
x>>>5 = 110012918 <----------
x>>5 = -24204810
Second, x = 0 | 16405315271
x>>>5 = 110012918
x>>5 = -24204810

but on Konqueror gives
First, x = 16405315271
x>>>5 = 67108864 <----------
x>>5 = -24204810
Second, x = 0 | 16405315271
x>>>5 = 110012918
x>>5 = -24204810

Is this difference responsible for my problem ? If so, if anybody
has any idea how to tweak functions tea_code and tea_decode so as to
make Konqueror behave like the others, I'd be very happy to hear it ...

Regards, Peter

--

Peter Billam, DPIWE/ILS/CIT/Servers, hbt/lnd/l8, 6233 3061
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Reimar Bauer | last post by:
I have a problem with form submissions by konqueror. First I will say the same form works fine with mozilla. A form using the GET method works fine in both! But if I use a php form with POST...
2
by: Gustav Medler | last post by:
Gustav Medler <nospam.gm@nurfuerspam.de> wrote/schrieb: Is KDE/ Konqueror browser supporting ommouseover="window.status...."? It does not in my test systems with Knoppix 3.4/Debian or Suse 9.0. ...
14
by: DU | last post by:
According to a recent post, it seems that Konqueror 3.1+ and Safari 1.1 support CSS3 opacity style property under a proprietary name: "Support for the CSS3 opacity (using -khtml-opacity)...
1
by: Roger | last post by:
I am trying to capture the image coordinates when a user clicks on an image. My code is working in Firefox, Mozilla, Netscape, IE, and Opera, but fails under Konqueror (and I suspect Safari). ...
10
by: bessington | last post by:
hey all, i'm having a rather bizarre problem.. the image tag i have declared in my xhtml is not showing in safari / konqueror but showing just fine in Firefox, IE, Opera... this is a complete...
1
by: Thomas Bandt | last post by:
Hi all, I was really surprised a few minute ago to see that my pages which run everywhere fine don't do this on Konqueror browser on Linux OS. The page at itself works, but ASP.NET don't...
0
by: Sven Rudolph | last post by:
Hi, I just made a web site and stumbeled upon something, that seems to be a stylesheets bug in Konqueror. When Iuse :first-letter on the a-tag, Konqueror doubles the first letter when I click...
3
by: Gregor Kofler | last post by:
Trying my widgets on Konqueror 3.5.9/Ubuntu 8.04 gives me the following error message: line 172: Error: DOM Exception 8 The mentioned line contains: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.