Search:

Type: Posts; User: lovesunset21

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Thanks for your code, I understood. In case I...

    Thanks for your code, I understood. In case I want to shift right, I write the code like that:


    void shiftright(uint64_t *x)
    {
    int i;
    unsigned char a,b=0;
    b=x[0]&1;
    for...
  2. What happen if I try the code like this? Is this...

    What happen if I try the code like this? Is this correct?


    void shiftleft(uint64_t *x)
    {
    unsigned char a,b=0;
    int i;
    b=x[19]& (1ULL<<63);
    for (i=19;i>=0;i--){
    a=x[i] &...
  3. I am so sorry. I understand the rule to shift the...

    I am so sorry. I understand the rule to shift the bit to the left but I am really confused about the bit position. That's the reason why I do something stupid in my code. Let's me explain my code and...
  4. In the shiftleft above, I do as followed: 1....

    In the shiftleft above, I do as followed:

    1. shift 0 to left

    2. check if the extreme left of 1 is 1, make a note.

    3. shift 1 to left

    4. if it is noted, set the extreme right of 0 to 1.
  5. My problem is that when I tried shifleft function...

    My problem is that when I tried shifleft function above. It seems right. I cannot find the wrong. Oh, I am going to be crazy

    0000000000000000000000000000000000000000000000000000000000000001 ...
  6. I rewrite my shiftleft and it seems correct....

    I rewrite my shiftleft and it seems correct. However, my program still works inaccurately.


    void shiftleft(uint64_t *x)
    {
    unsigned char a,b=0;
    int i;
    //b=x[19]& (1ULL<<63);
    for...
  7. Amazing, why does it become all 0 after...

    Amazing, why does it become all 0 after shiftleft? My shiftleft is wrong....
  8. When I try to print the result of my shiftleft,...

    When I try to print the result of my shiftleft, it is for example:


    before:
    0110011001011101001100110010100100011010010101000100100111010000 ...
  9. Thanks for your reply. Do you mean that I should...

    Thanks for your reply. Do you mean that I should turn off the 1279th bit?

    Is there any problem in my leftshift? Please tell me.
  10. multiplication function in Binary Field, please help

    Hi everyone,

    I am trying to make a multiplication function in Binary Field with GF2m, f(x)=x^1279 + x^319 + x^127 + x^63 + 1.

    Unfortunately, It does not work properly. I don't know why. Could...
  11. Replies
    2
    Views
    1,413

    Thanks so much cas

    Thanks so much cas
  12. Replies
    2
    Views
    1,413

    uint64_t please help

    Hi everyone,

    I try to work with an uint64_t as followed:

    uint64_t a;

    a=a| 1 <<63;

    And it displays: "gf2m.c:71: warning: left shift count >= width of type". I don't know why. Please help...
  13. how to mod an array of uint64_t, please help

    Hi everyone,

    I have two array of uint64_t values: a and b.

    For example:

    a={0x0B922A5894CCBA66ULL,0x1860C1FA43DFA1D6ULL,0x0A2C46E6F566C8BBULL}...
  14. Replies
    10
    Views
    12,249

    Thank you so much. I try and It works right now....

    Thank you so much. I try and It works right now. It's great.

    I have one more question. If I want to set bit at a position into a bit t. What should I do?

    For example:

    I have bit t.

    In...
  15. Replies
    10
    Views
    12,249

    Thanks for your help. This is my code. I have an...

    Thanks for your help. This is my code. I have an unsigned char array with 36 elements.

    unsigned char s[36]


    #define bit_at(a,i) !!(a[i / 8] >> (8 - (i % 8) - 1) & 1) //I copy this code from...
  16. Replies
    10
    Views
    12,249

    Hi everyone, I really need your help. How can I...

    Hi everyone, I really need your help. How can I shift byte array as above. Thank you so much.
  17. Replies
    10
    Views
    12,249

    I don't know how to shift bit in a byte array...

    I don't know how to shift bit in a byte array with the first bit of a byte is the last bit of the previous as above. I have searched in Google.
  18. Replies
    10
    Views
    12,249

    how can I shift bit right a byte array

    Hi everyone, I need your help in shifting right the byte array. For example:

    I have 3 bytes :

    s1s2s3s4s5s6s7s8 s9s10s11s12s13s14s15s16 s17s18s19s20s21s22s23s24

    ---> 0s1s2s3s4s5s6s7...
  19. Replies
    27
    Views
    4,610

    What should we add into the code as Salem told? I...

    What should we add into the code as Salem told? I am a dummy C. Therefore, I don't really understand his idea. Thanks
  20. Replies
    27
    Views
    4,610

    That's right. It should be 8, but it is alway 1....

    That's right. It should be 8, but it is alway 1. I am running it on Eclipse and Ubuntu
  21. Replies
    27
    Views
    4,610

    Yes, of course, I copy and paste #include...

    Yes, of course, I copy and paste



    #include <stdio.h>
    #include <stdlib.h>
    typedef union t_byte_s
    { unsigned char MyByte;
    unsigned char b0:1,
    b1:1,
  22. Replies
    27
    Views
    4,610

    actually, when I try this: It is 1,...

    actually, when I try this:





    It is 1, not 4. It should be 4, right?
  23. Replies
    27
    Views
    4,610

    Thanks so much. Can you explain the UNION keyword...

    Thanks so much. Can you explain the UNION keyword for me?
  24. Replies
    27
    Views
    4,610

    Thanks so much. But i don't really understand. ...

    Thanks so much. But i don't really understand.


    typedef struct
    {
    unsigned b1:1;
    unsigned b2:1;
    unsigned b3:1;
    unsigned b4:1;
    unsigned b5:1;
  25. Replies
    27
    Views
    4,610

    Thanks a lot. I have solved my problem. However,...

    Thanks a lot. I have solved my problem. However, I still have question, please help me.

    I am working with bit field. I have


    typedef struct bytes{
    unsigned char b8:1;
    unsigned char...
Results 1 to 25 of 38
Page 1 of 2 1 2