Updates from March, 2010 Toggle Comment Threads | Keyboard Shortcuts

  • CG 3:08 pm on March 28, 2010 Permalink | Reply  

    Debugging headache 

    phd student is having big headache figuring out why a simple operation 2P – P is not equal to P. going to have a holiday without bringing the laptop but still have this problem unsolved… arrrrrrhhhh!!!

            data->e[NUMWORD] = 0x6000000;
            data->e[NUMWORD-1] = 0x0;
            data->e[NUMWORD-2] = 0x0;
            data->e[NUMWORD-3] = 0x0;
            data->e[NUMWORD-4] = 0x6f0a0000;
            data->e[NUMWORD-5] = 0x68616c6c;
    
            print_field("data test = ", data);
    
            //t is for storing the k
            null(t);
            t->e[NUMWORD] = 2;   //k  = 2, Q = 2*P
            print_field("t = ", t);
            printf("setting up curves\n\n");
            set_curve(curve);
            print_curve("the curve after setting up: ", curve);
    
            poly_embed(data, curve, 1, 0, p);
            printf("data after embedded to the curve: \n");
            print_point("p = ", p);
    
            printf("after point multiplication: \n");
            poly_elptic_mul(t, p, r, curve);
            print_point("r = ", r);
    
            null(t);
            t->e[NUMWORD] = 1;  
            print_field("t = ", t);
            printf("get the point back: \n");
            poly_elptic_mul(t, p, q, curve);
            print_point("q = ", q); 
            poly_esub(r, q, s, curve);
            print_point("s = ", s);
    


    poly_prime =
    8 0 0 0 0 c9
    NUMWORD = 5
    data test =
    68616c6c 6f0a0000 0 0 0 6000000
    t =
    0 0 0 0 0 2
    setting up curves

    the curve after setting up:
    form: 1
    a2: 2 0 0 0 0 0
    a6: 1 0 0 0 0 0

    counter = 0
    inc = 1
    data after embedded to the curve:
    p =
    x: 68616c6c 6f0a0000 0 0 0 6000000
    y: 2 7fcb6ca7 1bdfc7ca 17329198 9524f59c ec7659ad
    after point multiplication:
    r =
    x: 68616c6c 90451c30 58c15ae5 9afb81ac 98bea99d 567b1a47
    y: 2 ddf40f6e adf0823c 6931b5e1 be2b181a 4cafded5
    t =
    0 0 0 0 0 1
    get the point back:
    q =
    x: 68616c6c 6f0a0000 0 0 0 6000000
    y: 2 7fcb6ca7 1bdfc7ca 17329198 9524f59c ec7659ad
    s =
    x: 1 cf0b01a6 9e358040 b87f8a0d 56118a0a 50644166
    y: 0 5a4b1583 616c21cb 3ecc2d26 d99e32df ac36450

     
    • niken 2:50 pm on April 2, 2010 Permalink | Reply

      libur dulu aja…. jangan pikirin ini pas liburan…. ya? ya? ya? nanti pas balik baru deh 😀

  • CG 8:39 am on March 20, 2010 Permalink | Reply
    Tags: hawlett packard F300, scanning problems,   

    Snow Leopard does not support F300 yet :( 

    Oh well :(( Now scanning cannot be done on Snow Leopard 😦 When will they release the update?

    More scanning problems on Snow Leopard and tips here, here, and here.

    Apparently I have to use other OS to do the scanning, or buy a new printer. *#($&)$*&)(#*&$(#$^%*#$!!!

     
  • CG 3:20 pm on March 17, 2010 Permalink | Reply
    Tags: iSync, nokia 5800, , symbian s60   

    Synchronizing Nokia 5800 with iSync on Snow Leopard 

    … works with USB but not with bluetooth. why?

    but i’m happy enough to finally have my nokia5800 synchronized with my mac  using iSync 🙂
    now i have backup for contacts and iCal! yay!

    [just forget that i have just soft reset my nokia5800 and lost the contact and calendars and notes 2 days ago just BEFORE i finally found that symbian can really talk with mac os. oh well, better late than never 😀 ]

    Picture taken from here.

     
    • tasha 8:02 am on March 18, 2010 Permalink | Reply

      say,
      tanggung.. beli iphone sekalian aja. Mac bs diinstal bajakan g? 😀

  • CG 11:26 am on March 10, 2010 Permalink | Reply
    Tags: elliptic curve point multiplication, , testing   

    point multiplication testing 

    Point multiplication testing works.

    /* CG - March 2010
       program to check point multiplication
    */
    
    #include <stdio.h>
    #include <stdlib.h>
    #include "field2n.h"
    #include "poly.h"
    #include "eliptic.h"
    
    extern FIELD2N poly_prime;
    
    void set_field(value, n)
    FIELD2N *value;
    INDEX n;
    {
       value->e[0] = n;
    }
    
    void set_curve(curv)
    CURVE *curv;
    {
       curv->form = 1;
       set_field(&curv->a6, 1L);
       set_field(&curv->a2, 2L);
    }
    
    int main()
    {
            FIELD2N *data;
            FIELD2N *t;
    	FIELD2N y, x, y2, xy;
    	ELEMENT index, check;
            INDEX i, error;
    	FILE *del;
    	CURVE *curve;
            POINT *p, *r;
    	char curve_string[80];
    	
            data = malloc(sizeof(FIELD2N));
            if (data == NULL) {exit(-1);}
    
            t = malloc(sizeof(FIELD2N));
            if (t == NULL) {exit(-1);}
    
            curve = malloc(sizeof(CURVE));
            if (curve == NULL) {exit(-1);}
    
            p = malloc(sizeof(POINT));
            if (p == NULL) {exit(-1);}
    
            r = malloc(sizeof(POINT));
            if (r == NULL) {exit(-1);}
    
    	if (!irreducible(&poly_prime)) return(0);
    	print_field("poly_prime = ", &poly_prime);
    	
    	if (error = init_poly_math())
    	{
    		printf("Can't initialize S matrix, row = %d\n", error);
    		return(-1);
    	}
    
            data->e[0] = 1L;	
            data->e[1] = 1L;
            print_field("data test = ", data);
    
    //        printf("NUMWORD = %ld\n", NUMWORD );
            null(t);
            t->e[NUMWORD] = 2L;
            print_field("t = ", t);
    
            printf("setting up curves\n\n");
            set_curve(curve);
            print_curve("the curve after setting up: ", curve);
    
            poly_embed(data, curve, 1, 0, p);
            printf("data after embedded to the curve: \n");
            print_point("p = ", p);
    
            printf("after point multiplication: \n");
            poly_elptic_mul(t, p, r, curve);
            print_point("r = ", r);	
    }
    

    This is the result of 2P.

    lss-67-23:Rosing Experiments CG chika$ ./test_left_right_eq2
    poly_prime =
    8 0 0 0 0 c9

    NUMBITS = 163
    NUMWORD = 5
    MAXLONG = 6
    a2 =
    2 0 0 0 0 0
    a6 =
    1 0 0 0 0 0

    1 1899fea5 56c420f2 9e4b1f87 5cb6b783 899feb0c
    y =
    1 26a707a1 8daf42c0 dde1d433 6638016d fd2dfcd4
    yy =
    0 1460a86a b5fd89df 6fc41f77 67325e56 91b4cecb
    xy =
    6 ed2088de 820e441 93687252 d3242e3a 62be995e
    x_2 =
    4 3e3b1763 9148e81e efc41b97 24c6e697 82da1543
    x_3 =
    4 ae6b51e0 468d0597 9c179778 e018bf6e 60eb0e54
    ax2 =
    3 572b7154 fb506809 60bbfa5d 540ecf02 93e159c1
    left =
    6 f94020b4 bddd6d9e fcac6d25 b416706c f30a5795
    right =
    6 f94020b4 bddd6d9e fcac6d25 b416706c f30a5795

    And this is for 10P

    lss-67-23:Rosing Experiments CG chika$ ./test_left_right_eq2
    poly_prime =
    8 0 0 0 0 c9

    NUMBITS = 163
    NUMWORD = 5
    MAXLONG = 6
    a2 =
    2 0 0 0 0 0
    a6 =
    1 0 0 0 0 0

    3 91d7e88a 1bb31eaf bdf2e27d bf0271b6 333c29ce
    y =
    3 5d3c582c cbc0a643 fe11bd5a f6e54c0 41df835f
    yy =
    5 69b24b3f 8d3d7709 cd222a06 3d76432f 401b8c42
    xy =
    6 53764521 604fe896 ed4d10b9 660cd6e3 6c398bdd
    x_2 =
    7 a53af799 5d9b4e28 8a12d0c9 bb9dae71 9625d3c3
    x_3 =
    4 6d0ed674 6bfff7dd f5b93ab2 88c98b98 c3079c7f
    ax2 =
    6 57cad86a 868d6842 d5d6000d d3b31e54 ef259be0
    left =
    3 3ac40e1e ed729f9f 206f3abf 5b7a95cc 2c22079f
    right =
    3 3ac40e1e ed729f9f 206f3abf 5b7a95cc 2c22079f

     
  • CG 2:10 pm on March 8, 2010 Permalink | Reply
    Tags: c language, quine, self generating code   

    This is INTERESTING. http://rsatrioadi.w… 

    This is INTERESTING.

    http://rsatrioadi.wordpress.com/2010/03/06/ii3062-quine/

    More about it here.

     
    • Satrio Adi Rukmono 2:19 pm on March 8, 2010 Permalink | Reply

      wah saya di-feature.. makasih ya mas..

      • Satrio Adi Rukmono 2:22 pm on March 8, 2010 Permalink | Reply

        wah saya asal2an ini, baru baca about, maaf mbak, bukan mas 🙂

        • CG 2:24 pm on March 8, 2010 Permalink

          terimakasih kembali mas satrio 🙂
          gak apa2x, malah lebih bagus kalau gak jelas mas atau mbak 😀

  • CG 1:18 pm on March 5, 2010 Permalink | Reply
    Tags: , is on curve, , solving quadratic equation   

    More on testing points on curve 

    Have successfully tested two points:


    FIELD2N x = {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000};
    FIELD2N y = {0x00000003, 0x477aaa32, 0xb86eae40, 0xa053e2a8, 0x0c4b05c3, 0x073f1c94};

    and


    FIELD2N x = {0x00000001, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000};
    FIELD2N y = {0x00000004, 0xc2e04f09, 0x7ec85acb, 0x386fc4f1, 0x526affe9, 0xf6e4d3f5};

    on curve

    poly_prime =
    8 0 0 0 0 c9
    data :
    1 1 0 0 0 0
    setting up curves

    the curve after setting up:
    form: 1
    a2: 0 0 0 0 0 0
    a6: 1 0 0 0 0 0

    point->x :
    1 1 0 0 0 0
    f :
    0 4000141 4000141 4000141 4000000 1f68
    point result
    x: 1 2 0 0 0 0
    y: 4 c2e04f09 7ec85acb 386fc4f1 526affe9 f6e4d3f5

    The result:

    poly_prime =
    8 0 0 0 0 c9

    NUMBITS = 163
    NUMWORD = 5
    MAXLONG = 6
    a2 =
    0 0 0 0 0 0
    a6 =
    1 0 0 0 0 0

    1 2 0 0 0 0
    y =
    4 c2e04f09 7ec85acb 386fc4f1 526affe9 f6e4d3f5
    yy =
    0 8a736b80 84a3b214 9d4c0808 d81f0825 8aecb069
    xy =
    0 8e736902 8ca3b710 8d4c0200 f81f0825 8aecaf01
    x_2 =
    1 20000000 64 80000000 0 15b
    x_3 =
    1 4000282 8000504 10000a08 20000000 1f68
    ax2 =
    0 0 0 0 0 0
    left =
    0 4000282 8000504 10000a08 20000000 1f68
    right =
    0 4000282 8000504 10000a08 20000000 1f68

    the left equation is equal to the right equation. It’s on curve. Yay!

    [what’s next? thinking.]

     
  • CG 11:42 am on March 3, 2010 Permalink | Reply
    Tags: architecture 32-bit, architecture 64-bit, , ,   

    gcc compiling problems on snow leopard 

    Problems due to upgrading from 32-bit to 64-bit architecture.

    The error messages:

    ld: warning: in poly_func.o, file is not of required architecture
    ld: warning: in eliptic_poly.o, file is not of required architecture
    ld: warning: in polymain.o, file is not of required architecture

    Can be resolved by modifying the makefile, and instruct the compiler to compile it in 32-bit using -m32.
    The sourcecode of the Makefile:

    ALL:
    
    CFLAGS=-g -m32
    
    poly: polymain.o poly_func.o eliptic_poly.o eliptic_poly_main.o
    	gcc -o poly polymain.o poly_func.o eliptic_poly.o eliptic_poly_main.o
    
    poly_protocol.o: poly_protocol.c field2n.h
    	gcc -c poly_protocol.c
    
    polymain.o: polymain.c field2n.h
    	gcc $(CFLAGS) -c polymain.c
    
    poly_func.o: poly_func.c field2n.h
    	gcc $(CFLAGS) -c poly_func.c
    
    eliptic_poly.o: eliptic_poly.c field2n.h
    	gcc $(CFLAGS) -c eliptic_poly.c
    
    eliptic_poly_main.o: eliptic_poly_main.c field2n.h
    	gcc -c eliptic_poly_main.c
    
    polyCG: polyCG.o poly_func.o eliptic_poly.o polymain.o
    	gcc -o polyCG polyCG.o poly_func.o eliptic_poly.o polymain.o
    
    polyCG.o: polyCG.c field2n.h
    	gcc -c polyCG.c
    
    poly_mul_partial_CG: poly_mul_partial_CG.o poly_func.o eliptic_poly.o \
    	polymain.o
    	gcc -o poly_mul_partial_CG poly_mul_partial_CG.o \
    	poly_func.o eliptic_poly.o polymain.o
    
    poly_mul_partial_CG.o: poly_mul_partial_CG.c field2n.h
    	gcc -c poly_mul_partial_CG.c
    
    poly_mul_CG: poly_mul_CG.o poly_func.o eliptic_poly.o polymain.o
    	gcc -o poly_mul_CG poly_mul_CG.o poly_func.o eliptic_poly.o polymain.o
    
    poly_mul_CG.o: poly_mul_CG.c field2n.h
    	gcc -c poly_mul_CG.c
    
    test_left_right_eq: test_left_right_eq.o poly_func.o eliptic_poly.o polymain.o
    	gcc -o test_left_right_eq test_left_right_eq.o poly_func.o eliptic_poly.o polymain.o
    
    test_left_right_eq.o: test_left_right_eq.c field2n.h
    	gcc -c test_left_right_eq.c
    eliptic_poly_main_CG: eliptic_poly_main_CG.o poly_func.o eliptic_poly.o polymain.o
    	gcc -o eliptic_poly_main_CG eliptic_poly_main_CG.o poly_func.o eliptic_poly.o polymain.o
    
    eliptic_poly_main_CG.o: eliptic_poly_main_CG.c field2n.h
    
    small_curve_CG: small_curve_CG.o poly_func.o eliptic_poly.o polymain.o
    	gcc -o small_curve_CG small_curve_CG.o poly_func.o eliptic_poly.o polymain.o
    
    small_curve_CG.o: small_curve_CG.c field2n.h
    	gcc -c small_curve_CG.c
    
    test_protocol_CG: test_protocol_CG.o poly_func.o eliptic_poly.o polymain.o
    	gcc -o test_protocol_CG test_protocol_CG.o poly_func.o eliptic_poly.o polymain.o
    
    test_protocol_CG.o: test_protocol_CG.c field2n.h
    	gcc -c test_protocol_CG.c
    
    calc_x_to_get_y: calc_x_to_get_y.o poly_func.o eliptic_poly.o polymain.o
    	gcc $(CFLAGS) -o calc_x_to_get_y calc_x_to_get_y.o poly_func.o eliptic_poly.o polymain.o
    
    calc_x_to_get_y.o: calc_x_to_get_y.c field2n.h
    	gcc $(CFLAGS) -c calc_x_to_get_y.c
    
    point_field2n_test: point_field2n_test.o poly_func.o eliptic_poly.o polymain.o
    	gcc $(CFLAGS) -o point_field2n_test point_field2n_test.o poly_func.o eliptic_poly.o polymain.o
    
    point_field2n_test.o: point_field2n_test.c field2n.h
    	gcc $(CFLAGS) -c point_field2n_test.c
    
    junk: junk.o poly_func.o eliptic_poly.o polymain.o
    	gcc $(CFLAGS) -o junk junk.o poly_func.o eliptic_poly.o polymain.o
    
    junk.o: junk.c field2n.h
    	gcc $(CFLAGS) -c junk.c
    
    

    Thank you for the big help of the coding wizard 🙂

    *Similar problems on this:
    1. http://www.mail-archive.com/pd-list@iem.at/msg30035.html
    2. http://gmplib.org/list-archives/gmp-bugs/2009-October/001636.html
    3. http://stackoverflow.com/questions/1455720/mac-osx-10-6-compiler-a-puzzling-experience-with-32-vs-64-bit
    4. http://gmplib.org/list-archives/gmp-bugs/2009-November/001696.html
    5. http://trac.macports.org/ticket/20933

     
    • Budi Rahardjo 11:54 am on March 3, 2010 Permalink | Reply

      🙂 … ha … more compling problem(s).
      I am going to wait before upgrading to snow leopard.

      • CG 5:28 pm on March 3, 2010 Permalink | Reply

        don’t 🙂 we need a stabile and predictable platform to test the simulator 🙂

        • bobby 11:31 pm on March 4, 2010 Permalink

          bukannya tadi di kelas udah beres, lancar lancar aja kan

        • CG 4:27 am on March 5, 2010 Permalink

          @bobby: ya, sementara lancar 🙂 semoga gak ada masalah lagi. sudah install mac update 🙂

  • CG 2:06 pm on March 2, 2010 Permalink | Reply
    Tags: , papers   

    now reading… 

    1. Efficient Methods for Composite Field Arithmetic, E. Savas and C. K. Koc, Technical Report, December 1999.
    2. Fast Arithmetic for Public-Key Algorithms in Galois Fields with Composite Exponents, Christof Paar, Peter Fleischmann, IEEE Transactions on Computers, October 1999, vol. 48, no. 10, pp. 1025-1034.
    3. Fast Arithmetic Architectures for Public-Key Algorithms over Galois Fields GF((2^n)^m), Christof Paar, EUROCRYPT ’97, LNCS 1233, Springer-Verlag, pp. 363-378,1997.
    4. A Fast Software Implementation fo Arithmetic Operations in GF(2^n) (preprint), Erik De Win, Antoon Bosselars, Servaas Vandenberghe, Peter De Gersem, Joos Vandewalle
    5. Efficient Algorithms for Elliptic Curve Cryptosystems, Jorge Guajardo, Master Thesis, Worcester Polytechnic Institute, 1997.
    6. Efficient Algorithms for Elliptic Curve Cryptosystems, Jorge Guajardo, Christof Paar, Advances in Cryptology – CRYPTO ’97, LNCS 1294, pp. 342-356, 1997.
     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel