Thanks, yes switching those type casts to C.size_t worked.

On Saturday, December 3, 2022 at 2:39:24 PM UTC-5 kortschak wrote:

> On Sat, 2022-12-03 at 10:51 -0800, David Stainton wrote:
> > Greetings,
> >
> > I think my question is something like: "how to make my usage of
> > C.uint64_t work on all platforms?" or "Is there something obviously
> > wrong with my cgo bindings that is causing this not to build on all
> > platforms?"
> >
> > I wrote this cgo binding for the reference implementation of Sphincs+
> > (it's a hash based post quantum signature scheme):
> >
> > 
> https://github.com/katzenpost/katzenpost/blob/main/sphincsplus/ref/binding.go
> >
> > Recently we noticed it fails to build on MacOS and Windows:
> >
> > 
> https://github.com/katzenpost/katzen/actions/runs/3609590801/jobs/6082872618
> >
> > So I "fixed" it by changing the typecast to use C.uint64_t instead of
> > C.ulong:
> >
> > https://github.com/katzenpost/katzenpost/pull/110/files
> >
> > However that causes the build to fail using Go1.19.3 on MacOS,
> > although it works on Windows:
> >
> > 
> https://github.com/katzenpost/katzen/actions/runs/3609771045/jobs/6083165054
> >
> >
> > Sincerely,
> > David Stainton
>
> The header file definition for crypto_sign_signature uses size_t for
> the parameters that are passed as ulong in the calls that are causing
> the issue. These types are not always the same size, so perhaps in e.g.
>
> https://github.com/katzenpost/katzenpost/blob/a165cb2a13e40f3a15dd1fa296a7763d8b638ae0/sphincsplus/ref/binding.go#L120-L125
> making the ulong params be size_t would help.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ff839488-59ff-45d8-bd01-ebc47a9a473an%40googlegroups.com.

Reply via email to