473,395 Members | 1,972 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,395 software developers and data experts.

what the meaning of this?

anyone know is it this source code value:-
T = ((Y >> 4) ^ X) & 0x0F0F0F0F; X ^= T; Y ^= (T << 4);

T = ((Y ) ^ X) & 0x10101010; X ^= T; Y ^= (T );

X = (LHs[ (X ) & 0xF] << 3) | (LHs[ (X >> 8) & 0xF ] << 2)
| (LHs[ (X >> 16) & 0xF] << 1) | (LHs[ (X >> 24) & 0xF ] )
| (LHs[ (X >> 5) & 0xF] << 7) | (LHs[ (X >> 13) & 0xF ] << 6)
| (LHs[ (X >> 21) & 0xF] << 5) | (LHs[ (X >> 29) & 0xF ] << 4);

Y = (RHs[ (Y >> 1) & 0xF] << 3) | (RHs[ (Y >> 9) & 0xF ] << 2)
| (RHs[ (Y >> 17) & 0xF] << 1) | (RHs[ (Y >> 25) & 0xF ] )
| (RHs[ (Y >> 4) & 0xF] << 7) | (RHs[ (Y >> 12) & 0xF ] << 6)
| (RHs[ (Y >> 20) & 0xF] << 5) | (RHs[ (Y >> 28) & 0xF ] << 4);

X &= 0x0FFFFFFF;
Y &= 0x0FFFFFFF;

same as the PC-1 table value?

PC-1
57 49 41 33 25 17 9
1 58 50 42 34 26 18
10 2 59 51 43 35 27
19 11 3 60 52 44 36

63 55 47 39 31 23 15
7 62 54 46 38 30 22
14 6 61 53 45 37 29
21 13 5 28 20 12 4

and how to compare both?

Mar 3 '06 #1
7 2500
In article <11*********************@z34g2000cwc.googlegroups. com>,
newbie <ch*********@yahoo.com> wrote:
anyone know is it this source code value:-
T = ((Y >> 4) ^ X) & 0x0F0F0F0F; X ^= T; Y ^= (T << 4);

T = ((Y ) ^ X) & 0x10101010; X ^= T; Y ^= (T );

X = (LHs[ (X ) & 0xF] << 3) | (LHs[ (X >> 8) & 0xF ] << 2)
| (LHs[ (X >> 16) & 0xF] << 1) | (LHs[ (X >> 24) & 0xF ] )
You have not shown us the definition of LHs or RHs, so we cannot
tell you what this expression produces.
same as the PC-1 table value? PC-1
57 49 41 33 25 17 9
1 58 50 42 34 26 18
10 2 59 51 43 35 27
19 11 3 60 52 44 36

63 55 47 39 31 23 15
7 62 54 46 38 30 22
14 6 61 53 45 37 29
21 13 5 28 20 12 4 and how to compare both?

The code involves two input variables, X and Y, of at least 29
bits, and calculates 3 values, T, X, and Y. T could plausibly be
a temporary value, but the structure of the code shows that X and Y
are both outputs.

You ask that this output be compared to a single table, apparently
of size 8 x 7, or perhaps 2 x 4 x 7, and whose values appear to be
6 bits wide.

Even if we interpret the empty line as indicating two output tables,
one for X and the other for Y, we have a dimensionality clash:
the output of an operation upon a 29+ bit value cannot be less than
2^29th values [even if all the rest of them turn out to be 0]
and a single variable of output cannot be compared to a 4 x 7 table
of outputs without a mapping function... and no mapping function
has been defined.

Hence, no matter what the arithmetic produces, we can deduce
that it does -not- produce the table we are asked to compare against.
[Thus we do not need to analyze the bit-manipulation logic to produce
the definite answer "NO".]
--
"law -- it's a commodity"
-- Andrew Ryan (The Globe and Mail, 2005/11/26)
Mar 3 '06 #2
the RH and LH as below:-

static uint32 LHs[16] =
{
0x00000000, 0x00000001, 0x00000100, 0x00000101,
0x00010000, 0x00010001, 0x00010100, 0x00010101,
0x01000000, 0x01000001, 0x01000100, 0x01000101,
0x01010000, 0x01010001, 0x01010100, 0x01010101
};

static uint32 RHs[16] =
{
0x00000000, 0x01000000, 0x00010000, 0x01010000,
0x00000100, 0x01000100, 0x00010100, 0x01010100,
0x00000001, 0x01000001, 0x00010001, 0x01010001,
0x00000101, 0x01000101, 0x00010101, 0x01010101,
};

so what the expression produce?

Mar 5 '06 #3
In article <11**********************@v46g2000cwv.googlegroups .com>,
newbie <ch*********@yahoo.com> wrote:
the RH and LH as below:-
Q: How do you tell that someone is using google groups as their
newsreader?

A: Look for the complete lack of quoting and attribution.

static uint32 LHs[16] =
{
0x00000000, 0x00000001, 0x00000100, 0x00000101, static uint32 RHs[16] =
{
0x00000000, 0x01000000, 0x00010000, 0x01010000, so what the expression produce?


Which expression? As I pointed out before, the code obviously
calculates *two* values, X and Y, not just *one* value.

Your original question was, if I recall correctly, whether the
code produced the same answer as the table of values you showed.
[If I don't recall correctly, it's because you failed to quote
appropriate context.]

Examining the code and examining the table of values, without
knowing what a "PC-1" is, and without figuring out exactly what the
code calculates, we can determine that the code does not produce
the given table of values -- not unless there are some unstated
restrictions on the input values.

To prove that the table values are not what the code produces, start
with X and Y both 0. T is calculated in terms of shifts and XOR.
Unsigned shifts never introduce binary 1's where there were none
to start with, so the shifts are going to leave the values as 0.
Similarily, XOR of 0 and 0 is 0, so the XOR is not going to
introduce any new binary 1's. We can thus deduce that at the
end of the introductory sequence, X, Y, and T will all be 0 when
X and Y started at 0.

Now look at the pair of long expressions. There are lookups and
shifts and binary ORs. Again shifts and OR do not introduce new 1s
out of 0's. But it is the looked-up values that are manipulated,
so examine those. In each case, the array index used is a shift
and AND of X or Y, and we know X and Y are 0 here, so in each
case the array index used is going to be 0. And when we look
at LHS[0] and RHS[0], we see 0's in both locations. From this
we can deduce that when X and Y start out as 0, the final X and Y
values are both going to come out as 0.

If we know look at the PC-1 table of values given, then no matter
how we mentally account for the mismatch in dimensions, we can see
that none of the PC-1 values are ever 0. There is thus an output
pair from the code that is not to be found in the PC-1 values,
and hence the PC-1 values are not those produced by the code --
at least to the limits of the documentation we are given about the
input ranges.
--
Programming is what happens while you're busy making other plans.
Mar 5 '06 #4
newbie wrote:

the RH and LH as below:-

static uint32 LHs[16] =
{
0x00000000, 0x00000001, 0x00000100, 0x00000101,
0x00010000, 0x00010001, 0x00010100, 0x00010101,
0x01000000, 0x01000001, 0x01000100, 0x01000101,
0x01010000, 0x01010001, 0x01010100, 0x01010101
};

static uint32 RHs[16] =
{
0x00000000, 0x01000000, 0x00010000, 0x01010000,
0x00000100, 0x01000100, 0x00010100, 0x01010100,
0x00000001, 0x01000001, 0x00010001, 0x01010001,
0x00000101, 0x01000101, 0x00010101, 0x01010101,
};

so what the expression produce?


Those are not expressions, they are initialization statements
attached to a declaration. Who knows what they are intended to
represent.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
Mar 5 '06 #5
Walter Roberson wrote:
.... snip ...
Q: How do you tell that someone is using google groups as their
newsreader?

A: Look for the complete lack of quoting and attribution.


Most of the time just read the Organization: header in the
article. If this says google, and the article is properly quoted,
snipped, and not top-posted, you are fairly safe in assuming the
writer to be an intelligent lifeform.

At other times the user-agent: or X-newsreader: headers may be
present and informative. Seeing these things involves viewing full
headers or message source.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
Mar 5 '06 #6
CBFalconer wrote:
Walter Roberson wrote:

... snip ...

Q: How do you tell that someone is using google groups as their
newsreader?

A: Look for the complete lack of quoting and attribution.


Most of the time just read the Organization: header in the
article. If this says google, and the article is properly quoted,
snipped, and not top-posted, you are fairly safe in assuming the
writer to be an intelligent lifeform.

At other times the user-agent: or X-newsreader: headers may be
present and informative. Seeing these things involves viewing full
headers or message source.


Or have a newsreader that allows you to customize the headers that are
displayed. I added User-Agent to the usual From, Subject, and
Newsgroups lines. That way, when I see G2/0.2 I know it's Google and
can tailor my response as needed.
Brian

Mar 6 '06 #7
In article <44***************@yahoo.com>,
CBFalconer <cb********@maineline.net> wrote:
Walter Roberson wrote:
Q: How do you tell that someone is using google groups as their
newsreader? A: Look for the complete lack of quoting and attribution.
At other times the user-agent: or X-newsreader: headers may be
present and informative. Seeing these things involves viewing full
headers or message source.


The header fields are densely packed; it's a lot faster to notice the
lack of quoting and attribution.

Admittedly, the correlation is not 100%, but it has become so common
these days that we are going to have to come up with a new
expression to describe it, as it seems to me that we are
now beyond the behaviour set implied by "The Endless September".
How does "The Endless Google" ring?
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest
Mar 6 '06 #8

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

Similar topics

12
by: jinal jhaveri | last post by:
Hi All, I have one question regarding circular inheritance I have 3 files 1) A.py , having module A and some other modules 2) B.py having module B and some other modules 3) C.py having...
112
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please,...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
17
by: candy_init | last post by:
I sometimes comes across statements which invloves the use of size_t.But I dont know exactly that what is the meaning of size_t.What I know about it is that it is used to hide the platform...
7
by: KevinLee | last post by:
I found that the STL.NET published with VS Beta2, but what is the meaning of STL.NET. Is it just a simple wrapper to replace the old std stl? I can find nothing new but the keyword 'Generate' to...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
132
by: Frederick Gotham | last post by:
If we look at a programming language such as C++: When an updated Standard comes out, everyone adopts it and abandons the previous one. It seems though that things aren't so clear-cut in the C...
22
by: nospam_news | last post by:
I currently get asked about my usage of "auto". What is it for? The keyword is clearly superflous here. In contrast to the huge majority of C/C++ developers I write definitions very explicitly...
4
by: Virtual_X | last post by:
it's only language confusion i am non-english speaker so i heard about stream in alot of c++ tutorials ie: in iostream and in sstream headers in sstream we use the class stringstream to...
5
by: =?Utf-8?B?Sm9seW5pY2U=?= | last post by:
Hi everyone, I am learning c# and i don´t understand a piece of code , can anyone explain the meaning of this code please. public class vector { public double? R = null; //I suppose this...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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
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 projectplanning, coding, testing,...

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.