private static void Check_lax_sig(string expr) { var secp = Secp256K1.WithoutCaps(); var sigBytes = HexUtil.from_hex(expr); var sig = Signiture.from_der/*_lax*/ (secp, sigBytes); Assert.NotEmpty(sig.Value); }
public void Test_pubkey_from_slice_bad_context() { var s = Secp256K1.WithoutCaps(); var sk = SecretKey.New(s, RandomNumberGenerator.Create()); var ex = Assert.Throws <Exception>(() => { PublicKey.from_secret_key(s, sk); }); Assert.Equal("IncapableContext", ex.Message); s = Secp256K1.WithCaps(ContextFlag.VerifyOnly); ex = Assert.Throws <Exception>(() => { PublicKey.from_secret_key(s, sk); }); Assert.Equal("IncapableContext", ex.Message); s = Secp256K1.WithCaps(ContextFlag.SignOnly); PublicKey.from_secret_key(s, sk); s = Secp256K1.WithCaps(ContextFlag.Full); PublicKey.from_secret_key(s, sk); }