From aa8684e440c619cbff36bba1a9a96c9a503941ab Mon Sep 17 00:00:00 2001 From: Clawd Date: Thu, 19 Feb 2026 20:53:27 -0800 Subject: Add field_test.go, simplify main.go --- main.go | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 9e19d35..2f37773 100644 --- a/main.go +++ b/main.go @@ -3,31 +3,6 @@ package main import "fmt" func main() { - fmt.Println("=== secp256k1 from scratch ===") - fmt.Println() - - // Test field arithmetic with small numbers first - fmt.Println("Testing field arithmetic:") - - a := NewFieldElementFromInt64(7) - b := NewFieldElementFromInt64(5) - - fmt.Printf("a = %d\n", 7) - fmt.Printf("b = %d\n", 5) - fmt.Printf("a + b = %s (should end in ...c)\n", a.Add(b).String()) - fmt.Printf("a - b = %s (should end in ...2)\n", a.Sub(b).String()) - fmt.Printf("a * b = %s (should end in ...23, which is 35)\n", a.Mul(b).String()) - - // Test division: 10 / 5 = 2 - ten := NewFieldElementFromInt64(10) - five := NewFieldElementFromInt64(5) - fmt.Printf("10 / 5 = %s (should end in ...2)\n", ten.Div(five).String()) - - // Test inverse: 5 * inverse(5) should = 1 - inv := five.Inverse() - product := five.Mul(inv) - fmt.Printf("5 * inverse(5) = %s (should end in ...1)\n", product.String()) - - fmt.Println() - fmt.Println("Field arithmetic works!") + fmt.Println("secp256k1 from scratch") + fmt.Println("Run: go test -v") } -- cgit v1.2.3