pike.git / src / post_modules / Nettle / testsuite.in

version» Context lines:

pike.git/src/post_modules/Nettle/testsuite.in:1920:    lambda(string in) {    return Gmp.bignum(in-" "-"\n",16);    });   ]])      dnl test_ecdsa(curve, gwx, gwy, w, k, hash, r, s)   define(test_ecdsa,[[   test_do([[    add_constant("C", Nettle.ECC_Curve(1, $1, 1));   ]]) - test_equal([[ + test_eq([[    // Verify derivation of the public key. -  C * T(#"$4") +  (C * T(#"$4"))->get_x()   ]], [[ -  ({ T(#"$2"), T(#"$3") }) +  T(#"$2")   ]]) -  + test_eq([[ +  // Verify derivation of the public key. +  (C * T(#"$4"))->get_y() + ]], [[ +  T(#"$3") + ]])   test_any([[    // Validate signing.    object e = C.ECDSA();    e->set_private_key(T(#"$4")); // w    string pool = H(#"$5"-" "-"\n"); // k    string rnd(int s) {    if(s==0) error("random called with 0.\n");    if(s>sizeof(pool)) error("More random than needed requested.\n");    string r = pool[..s-1];    pool = pool[s..];
pike.git/src/post_modules/Nettle/testsuite.in:2005:    B19F2F28 1A7E0B22 C269D93C F8794A92 78880ED7 DBB8D936 2CAEACEE 54432055    2251,   017705A7 030290D1 CEB605A9 A1BB03FF 9CDD521E 87A696EC 926C8C10 C8362DF4    97536710 1F67D1CF 9BCCBF2F 3D239534 FA509E70 AAC851AE 01AAC68D 62F86647    2660)      ]]) dnl Nettle.ECC_Curve      test_any([[    object c=Nettle.ECC_Curve(1,192,1); -  object p=c->Point(@(c*17)); +  object p=c*17;    return String.string2hex(p->encode());   ]], "0444275cd2e1f46dc3f9f57636c2b4213b8bb445930510ff8aefad8348fde30c87de438612a818e98d9b76a67ad25ddfd0")      test_any_equal([[    object p=Nettle.ECC_Curve(1,192,1)->Point(Stdio.Buffer(String.hex2string("0444275cd2e1f46dc3f9f57636c2b4213b8bb445930510ff8aefad8348fde30c87de438612a818e98d9b76a67ad25ddfd0")));    return ({ p->get_x(), p->get_y() })   ]],[[ ({ 1671125335834827806091558150169784167134350298655600213898, 5876882175903236860388081433302259871828398972419132219344 }) ]])      test_any_equal([[    object p=Nettle.ECC_Curve(1,192,1)->Point(String.hex2string("0444275cd2e1f46dc3f9f57636c2b4213b8bb445930510ff8aefad8348fde30c87de438612a818e98d9b76a67ad25ddfd0"));    return ({ p->get_x(), p->get_y() })   ]],[[ ({ 1671125335834827806091558150169784167134350298655600213898, 5876882175903236860388081433302259871828398972419132219344 }) ]])      test_do( add_constant( "test_adata" ) )   test_do( add_constant( "test_data" ) )   test_do( add_constant( "T" ) )   test_do( add_constant( "H" ) )   test_do( add_constant( "S" ) )      END_MARKER