|
Member 13023118 wrote:
Can any one helps me to understand linear and differential cryptanalysis of PRESENT and XTEA by giving me code c or links of each type. |
What is your initial analysis? where you faced the problem? do you have trouble understanding some part or thing as a whole.
The problem is, even if you give you whole code, you will not able to get benefit out it, as you need to understand the concept.
Please rephrase the question and ask where you facing problem. Hopes that's help you!
|
|
|
|
|
hello, can anyone helps me to know what does this function do I got confused in different operators. I will be grateul for you
void H(u64 diff, u64 &m, u64 &w) {
u64 m1 = 0;
u64 m8 = 0;
w = 0;
int i;
for (i = 0; i < BLOCK_SIZE; ++i) {
if ((diff >> i) & 1) {
m1 |= (0x1 << ((i+1)%BLOCK_SIZE));
m8 |= (0x1 << ((i+8)%BLOCK_SIZE));
}
}
m = (m1 | m8) ^ WORD_MASK;
for (i = 0; i < BLOCK_SIZE; ++i) {
if (
((m1 >> i) & 1) == 0 &&
((m8 >> i) & 1) == 1 &&
((m1 >> ((i+7) % BLOCK_SIZE)) & 1) == 1 &&
((m8 >> ((i+7) % BLOCK_SIZE)) & 1) == 0
)
w ^= (0x1ull << ((i+7) % BLOCK_SIZE));
}
m |= w;
}
|
|
|
|
|
Operators in c++ is a pretty broad topic, are you having difficulty with one in particular? If not, maybe take a look at one or more of these.
Operators in C++[^]
Operators - C++ Tutorials[^]
Operators in C++[^]
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
thanks Sir, but my problem is what this function do exactly I have an idea about operators
|
|
|
|
|
Looks like a CRC calculation on the data block. Look at code you haven't shown us and see what becomes of m & w.
You actually haven't given us enough surrounding code to be able to conclusively work it out.
In vino veritas
|
|
|
|
|
It looks like it is some sort of encryption. You should ask the person you got it from.
|
|
|
|
|
Member 13023118 wrote: ...what does this function do... Where did you get it from?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi. I have a simple app, explorer type, with treeview in left side, and listview in right side. On both of them, I handled OnRClick menu, and they are working fine. It is a possibility to fire them using [^]menu key from keyboard ?
|
|
|
|
|
What happens when you try it?
|
|
|
|
|
Nothing ... obviously that I have tried, but the popup menu fired on right click, does nothing when I hit menu key from keyboard ...
|
|
|
|
|
|
Yes, that is possible. You have to handle the appropriate message which is the WM_CONTEXTMENU message (Windows)[^].
That message will be send upon the context menu key press, Shift+F10, and when releasing the right mouse button.
|
|
|
|
|
Perfect ! I have just tested, and is working !! Thank you !
|
|
|
|
|
Hello,
In the list control, we have the function to get the top index in MFC, GetTopIndex(), but how can we have the index of the visible last row of the list control whether we scroll it or not? I am asking this question because I have to put a design on the bottom of the last row, even if I scroll it should stay on the last row's bottom. How should I refer to the last visible row programmatically?
Thanks in advance.
modified 23-Apr-17 7:52am.
|
|
|
|
|
If there's not a method for it loop from the first to the last item and when ItemIsVisible returns false break the loop the previous item was at the bottom.
|
|
|
|
|
Thanks, but this is not serving my purpose! Thanks anyways
|
|
|
|
|
The CListCtrl class provides the function GetCountPerPage()[^]:
Quote: Calculates the number of items that can fit vertically in the visible area of a list view control when in list view or report view. Use that to calculate the index of the item visible on the bottom:
int MyListCtrl::GetBottomIndex() const
{
int n = GetTopIndex() + GetCountPerPage() - 1;
if (n >= GetItemCount())
n = GetItemCount() - 1;
return n;
}
|
|
|
|
|
Many thanks, i will try this one out!
|
|
|
|
|
|
|
Well, do you know what the Eigenvalues and Eigenvectors are?
|
|
|
|
|
|
I read a demo code from a semiconductor producer, in cpu.h, there are some typedef structs for registers.
typedef struct {
u32_T asid;
struct {
u32_T ASID:10,
rsvd1:22;
};
} ASID_T;
According to the comments, I think the writer thought he defined a struct to represent the asid register, and the struct can be accessed in 32 bit pattern or bit-field way.
But, is this struct can do that, I mean, are the U32_T asid and the anonymous struct share a same memory location? I think it can't work. just want to hear some other opinions.
modified 21-Apr-17 15:42pm.
|
|
|
|
|
They don't share the same memory location. To do that the outer struct must be a union (see Union declaration - cppreference.com[^] ).
From my point of view you are right that it looks like a definition for shared access and that is an error in the documentation. To verify this have a look at the register specifications in the data sheet.
|
|
|
|
|
How about this struct:
typedef struct {
struct {
u32_T ASID:10,
rsvd1:22;
} asid;
} ASID_T;
it can implement the 32-bit access and bit access, right?
|
|
|
|