473,661 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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((20482 99521,595110280 ),
(-764348263,55490 5533,637549562,-283747546))
returns 1614127572, 339082849,
should be -451692928, 1589210186,

tea_decode((204 8299521,5951102 80),
(-764348263,55490 5533,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 1484
In article <sl************ ******@pjb.dpiw e.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
1646
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 method I got in konqueror the download dialogue. Does someone know if this is a bug in konqueror? Reimar
2
1611
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. There is a test page at www.praxis-wiesbaden.de/test/test2.html In both conditions Konqueror is not showing the onmouseover event, isn't it?
14
5773
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) property. Make entire blocks and inlines transparent without resorting to transparent PNGs." http://weblogs.mozillazine.org/hyatt/archives/2003_10.html#004249 Now, I have a demo page which works for MSIE 6 for Windows and Mozilla-based browsers but...
1
4450
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). The code below fails in Konqueror when the page is scrolled down; the coordinates are off by the scroll amount. My code in the html img tag: onClick="MLDot(event)" and the related statements in the MLDot function:
10
2150
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 mystery and I have been scouring every book / resource I can find but haven't come up with an answer. any one have any ideas? all other images in site showing fine - but they are declared as background images in the css. the site is:...
1
1282
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 deliver the JavaScript-Code which is necessary to run LinkButtons, AutoPostback and so on. So, is this a bug - and does anybody know about a bugfix, or have I to edit my own BrowserCaps like 2 years ago with
0
1091
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 on the link. I checked the page with the w3.org validation tools, but found no errors. Here is the code (only the necessary parts):
3
1452
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: this.layer.removeChild(this.layer.childNodes);
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8758
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7364
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.