We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,348 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

some doubt about syntex

j=h(a||b)


h= pesudo random function, a and b id 128 bit key.
1. What i understand is a or b and give this as a input to h. That will be output. Is it like that?

2. and i want to know that how can i store value 128 bit and perform OR operation?
i
s there any help

2
Contributors
1
Reply
2 Hours
Discussion Span
1 Year Ago
Last Updated
2
Views
newbie1234
Junior Poster in Training
74 posts since Feb 2012
Reputation Points: 8
Solved Threads: 0
Skill Endorsements: 0

That is correct but I believe you have misunderstood what the || operator does.

|| is the logical or operator, it's output is true or false, or in integer terms 1 or 0. The inputs are treated as logical inputs which means in C++ 0 = false anything else is true. Then the implements the boolean logic

OR truth table
A|B|Out
0|0| 0
0|1| 1
1|0| 1
1|1| 1

You could use bitwise |, that performs the boolean or operator on each pair of bits in the 2 variables, i.e. 0xF0 | 0x0F = 0xFF. But the output of | has the same number of bits as its largest input.

If that is pseudo code and a and b are 128 bit numbers then the easiest way to hold then is as an array of smaller integers, say an array of 4 32 bit integers.

Banfa
Practically a Master Poster
695 posts since Mar 2010
Reputation Points: 508
Solved Threads: 109
Skill Endorsements: 5

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0621 seconds using 2.8MB