Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Depends on how you define "always". :-) -- Larry Wall in <199710211647.JAA17957@wall.org>


devel / comp.lang.lisp / Re: Help to replicate go code in lisp

SubjectAuthor
* Help to replicate go code in lispBela Pecsek
`* Re: Help to replicate go code in lispBela Pecsek
 `* Re: Help to replicate go code in lispTom Russ
  `- Re: Help to replicate go code in lispBela Pecsek

1
Help to replicate go code in lisp

<d6e70647-28b5-4da5-9020-4c1e936582f1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16771&group=comp.lang.lisp#16771

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a05:620a:404e:: with SMTP id i14mr24109110qko.111.1640945186591; Fri, 31 Dec 2021 02:06:26 -0800 (PST)
X-Received: by 2002:a05:6808:23cb:: with SMTP id bq11mr25879862oib.2.1640945185665; Fri, 31 Dec 2021 02:06:25 -0800 (PST)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Fri, 31 Dec 2021 02:06:25 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=80.98.93.50; posting-account=Ymj_QAoAAABLZ-Z6PVAdEYNVgee3EDGl
NNTP-Posting-Host: 80.98.93.50
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d6e70647-28b5-4da5-9020-4c1e936582f1n@googlegroups.com>
Subject: Help to replicate go code in lisp
From: bela.pecsek@gmail.com (Bela Pecsek)
Injection-Date: Fri, 31 Dec 2021 10:06:26 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 26
 by: Bela Pecsek - Fri, 31 Dec 2021 10:06 UTC

I have just started learning ironclad and would like to convert a small go code to Common Lisp to benchmark the speed but I am struggling to make it work.

How would I do it?

package main

import ("fmt" "os" "strconv" "github.com/ethereum/go-ethereum/crypto/secp256k1")

func main() {
n := 1
if len(os.Args) > 1 {
var err error
n, err = strconv.Atoi(os.Args[1])
_ = err
}

privateKey := []byte{45, 238, 146, 112, 121, 40, 60, 60, 79, 202, 62, 249, 112, 255, 77, 56, 182, 69, 146, 227, 254, 10, 176, 218, 217, 19, 45, 112, 181, 188, 118, 147}

curve := secp256k1.S256()
px := curve.Gx
py := curve.Gy
for _i := 0; _i < n; _i++ {
px, py = curve.ScalarMult(px, py, privateKey)
}

fmt.Printf("%x,%x\n", px, py)
}

Re: Help to replicate go code in lisp

<15f1b538-d84c-48ae-b5d3-00cea018adebn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16772&group=comp.lang.lisp#16772

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:ac8:4c9b:: with SMTP id j27mr29661052qtv.656.1640948628516;
Fri, 31 Dec 2021 03:03:48 -0800 (PST)
X-Received: by 2002:a05:6808:13d3:: with SMTP id d19mr27006499oiw.149.1640948628234;
Fri, 31 Dec 2021 03:03:48 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Fri, 31 Dec 2021 03:03:48 -0800 (PST)
In-Reply-To: <d6e70647-28b5-4da5-9020-4c1e936582f1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.98.93.50; posting-account=Ymj_QAoAAABLZ-Z6PVAdEYNVgee3EDGl
NNTP-Posting-Host: 80.98.93.50
References: <d6e70647-28b5-4da5-9020-4c1e936582f1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <15f1b538-d84c-48ae-b5d3-00cea018adebn@googlegroups.com>
Subject: Re: Help to replicate go code in lisp
From: bela.pecsek@gmail.com (Bela Pecsek)
Injection-Date: Fri, 31 Dec 2021 11:03:48 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 29
 by: Bela Pecsek - Fri, 31 Dec 2021 11:03 UTC

On Friday, December 31, 2021 at 11:06:29 AM UTC+1, Bela Pecsek wrote:
> I have just started learning ironclad and would like to convert a small go code to Common Lisp to benchmark the speed but I am struggling to make it work.
>
> How would I do it?
>
> package main
>
> import ("fmt" "os" "strconv" "github.com/ethereum/go-ethereum/crypto/secp256k1")
>
> func main() {
> n := 1
> if len(os.Args) > 1 {
> var err error
> n, err = strconv.Atoi(os.Args[1])
> _ = err
> }
>
> privateKey := []byte{45, 238, 146, 112, 121, 40, 60, 60, 79, 202, 62, 249, 112, 255, 77, 56, 182, 69, 146, 227, 254, 10, 176, 218, 217, 19, 45, 112, 181, 188, 118, 147}
>
> curve := secp256k1.S256()
> px := curve.Gx
> py := curve.Gy
> for _i := 0; _i < n; _i++ {
> px, py = curve.ScalarMult(px, py, privateKey)
> }
>
> fmt.Printf("%x,%x\n", px, py)
> }
I've forgotten to mention that this should be the result for n=10
a6f7cbeb7125279820188fd73631f14e11789c665362b2f7464f53eb041d2329,3ed07e8738690958d8089d6dd7efdeda5dd9e9c9d8446513e42a17d3c553db49

Re: Help to replicate go code in lisp

<01555d75-4f55-4b8f-af91-94d61685eeb3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16773&group=comp.lang.lisp#16773

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a05:622a:1654:: with SMTP id y20mr31804086qtj.374.1641000377553;
Fri, 31 Dec 2021 17:26:17 -0800 (PST)
X-Received: by 2002:a9d:734d:: with SMTP id l13mr26575700otk.292.1641000377007;
Fri, 31 Dec 2021 17:26:17 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Fri, 31 Dec 2021 17:26:16 -0800 (PST)
In-Reply-To: <15f1b538-d84c-48ae-b5d3-00cea018adebn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:8000:7603:1703:484d:141c:153c:c454;
posting-account=05zmAwoAAAAJZM-3jv1hCWLHGZQceqwA
NNTP-Posting-Host: 2603:8000:7603:1703:484d:141c:153c:c454
References: <d6e70647-28b5-4da5-9020-4c1e936582f1n@googlegroups.com> <15f1b538-d84c-48ae-b5d3-00cea018adebn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <01555d75-4f55-4b8f-af91-94d61685eeb3n@googlegroups.com>
Subject: Re: Help to replicate go code in lisp
From: taruss@google.com (Tom Russ)
Injection-Date: Sat, 01 Jan 2022 01:26:17 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 34
 by: Tom Russ - Sat, 1 Jan 2022 01:26 UTC

On Friday, December 31, 2021 at 3:03:50 AM UTC-8, bela....@gmail.com wrote:
> On Friday, December 31, 2021 at 11:06:29 AM UTC+1, Bela Pecsek wrote:
> > I have just started learning ironclad and would like to convert a small go code to Common Lisp to benchmark the speed but I am struggling to make it work.
> >
> > How would I do it?
> >
> > package main
> >
> > import ("fmt" "os" "strconv" "github.com/ethereum/go-ethereum/crypto/secp256k1")

This Github link returns a 404 error.
That makes it very difficult to figure out what secp256k1.S256() and its associated methods Gx, Gy and ScalarMult do.

> >
> > func main() {
> > n := 1
> > if len(os.Args) > 1 {
> > var err error
> > n, err = strconv.Atoi(os.Args[1])
> > _ = err
> > }
> >
> > privateKey := []byte{45, 238, 146, 112, 121, 40, 60, 60, 79, 202, 62, 249, 112, 255, 77, 56, 182, 69, 146, 227, 254, 10, 176, 218, 217, 19, 45, 112, 181, 188, 118, 147}
> >
> > curve := secp256k1.S256()
> > px := curve.Gx
> > py := curve.Gy
> > for _i := 0; _i < n; _i++ {
> > px, py = curve.ScalarMult(px, py, privateKey)
> > }
> >
> > fmt.Printf("%x,%x\n", px, py)
> > }
> I've forgotten to mention that this should be the result for n=10
> a6f7cbeb7125279820188fd73631f14e11789c665362b2f7464f53eb041d2329,3ed07e8738690958d8089d6dd7efdeda5dd9e9c9d8446513e42a17d3c553db49

Re: Help to replicate go code in lisp

<a4e64039-a54b-4ab9-a673-2534ece20371n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16774&group=comp.lang.lisp#16774

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:ac8:6d35:: with SMTP id r21mr35604945qtu.9.1641058936053;
Sat, 01 Jan 2022 09:42:16 -0800 (PST)
X-Received: by 2002:a05:6830:14ce:: with SMTP id t14mr27719347otq.46.1641058935794;
Sat, 01 Jan 2022 09:42:15 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Sat, 1 Jan 2022 09:42:15 -0800 (PST)
In-Reply-To: <01555d75-4f55-4b8f-af91-94d61685eeb3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=80.98.93.50; posting-account=Ymj_QAoAAABLZ-Z6PVAdEYNVgee3EDGl
NNTP-Posting-Host: 80.98.93.50
References: <d6e70647-28b5-4da5-9020-4c1e936582f1n@googlegroups.com>
<15f1b538-d84c-48ae-b5d3-00cea018adebn@googlegroups.com> <01555d75-4f55-4b8f-af91-94d61685eeb3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a4e64039-a54b-4ab9-a673-2534ece20371n@googlegroups.com>
Subject: Re: Help to replicate go code in lisp
From: bela.pecsek@gmail.com (Bela Pecsek)
Injection-Date: Sat, 01 Jan 2022 17:42:16 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 40
 by: Bela Pecsek - Sat, 1 Jan 2022 17:42 UTC

On Saturday, January 1, 2022 at 2:26:19 AM UTC+1, Tom Russ wrote:
> On Friday, December 31, 2021 at 3:03:50 AM UTC-8, bela....@gmail.com wrote:
> > On Friday, December 31, 2021 at 11:06:29 AM UTC+1, Bela Pecsek wrote:
> > > I have just started learning ironclad and would like to convert a small go code to Common Lisp to benchmark the speed but I am struggling to make it work.
> > >
> > > How would I do it?
> > >
> > > package main
> > >
> > > import ("fmt" "os" "strconv" "github.com/ethereum/go-ethereum/crypto/secp256k1")
> This Github link returns a 404 error.
> That makes it very difficult to figure out what secp256k1.S256() and its associated methods Gx, Gy and ScalarMult do.
> > >
> > > func main() {
> > > n := 1
> > > if len(os.Args) > 1 {
> > > var err error
> > > n, err = strconv.Atoi(os.Args[1])
> > > _ = err
> > > }
> > >
> > > privateKey := []byte{45, 238, 146, 112, 121, 40, 60, 60, 79, 202, 62, 249, 112, 255, 77, 56, 182, 69, 146, 227, 254, 10, 176, 218, 217, 19, 45, 112, 181, 188, 118, 147}
> > >
> > > curve := secp256k1.S256()
> > > px := curve.Gx
> > > py := curve.Gy
> > > for _i := 0; _i < n; _i++ {
> > > px, py = curve.ScalarMult(px, py, privateKey)
> > > }
> > >
> > > fmt.Printf("%x,%x\n", px, py)
> > > }
> > I've forgotten to mention that this should be the result for n=10
> > a6f7cbeb7125279820188fd73631f14e11789c665362b2f7464f53eb041d2329,3ed07e8738690958d8089d6dd7efdeda5dd9e9c9d8446513e42a17d3c553db49

Sorry about this. Please note that this is not my code.

The code actually compiles without problem.

The github repo I thing is here
https://github.com/ethereum/go-ethereum/tree/master/crypto/secp256k1


devel / comp.lang.lisp / Re: Help to replicate go code in lisp

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor