[go-nuts] Re: CBOR / pq cryptography migration / software architecture golang question

2023-02-10 Thread David Stainton
this where a Sphinx Geometry object is an argument to the method which does the unmarshaling; and using that Sphinx Geometry to determine which concrete cryptographic key type should be used. On Friday, February 10, 2023 at 6:19:55 PM UTC-5 David Stainton wrote: > > Greetings people of

[go-nuts] CBOR / pq cryptography migration / software architecture golang question

2023-02-10 Thread David Stainton
Greetings people of golang, cryptographers, software architects, Hi. I'm a Katzenpost developer, it's a software project, not a legal entity: https://github.com/katzenpost We use the golang CBOR library: github.com/fxamacker/cbor Works great! Jumping right into the nitty gritty here... We have

Re: [go-nuts] cgo C.uint64_t compatiblity on multiple platforms?

2022-12-03 Thread David Stainton
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

[go-nuts] cgo C.uint64_t compatiblity on multiple platforms?

2022-12-03 Thread David Stainton
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

[go-nuts] Re: cgo: how to pass an entropy source from golang to C?

2022-10-19 Thread David Stainton
On Tuesday, October 18, 2022 at 9:50:21 PM UTC-4 David Stainton wrote: > > Okay here I've tried a similar solution to the go-pointers library... but > i had to change it a bit to fit how the C library uses the context pointer: > > https://git.xx.network/e

[go-nuts] Re: cgo: how to pass an entropy source from golang to C?

2022-10-18 Thread David Stainton
uot;rng is nil"... not sure why. So I'm going to try another solution where I change the C api slightly. I'm convinced there are many possible solutions to this and picking one is a matter of deciding among a few tradeoffs. On Tuesday, October 18, 2022 at 6:33:11 PM UTC-4 David Sta

[go-nuts] cgo: how to pass an entropy source from golang to C?

2022-10-18 Thread David Stainton
Greetings cgo experts, perhaps this post might also be of some interest to cryptography people as well. What's the best way for a C cryptography library to receive entropy from golang? There exists a C cryptography library (CTIDH, it's a PQ NIKE)... I am collaborating with C programmers who ar

Re: [go-nuts] cgo binding copies data twice, necessary?

2022-08-23 Thread David Stainton
seem that safe though. There should be something that > actually checks that the byte slice is the correct size. > > On Tue, 23 Aug 2022 at 00:41, David Stainton wrote: > >> I recently wrote cgo bindings to the CTIDH C library (a bleeding edge >> post quantum non-interactiv

[go-nuts] cgo binding copies data twice, necessary?

2022-08-22 Thread David Stainton
I recently wrote cgo bindings to the CTIDH C library (a bleeding edge post quantum non-interactive key exchange) copies the data twice. First in the call to C.CBytes and then again in the assignment to p.privateKey via that pointer dereference. The performance hit for the twice copy is not real

[go-nuts] Re: decode unknown CBOR type with set of known types

2020-07-10 Thread David Stainton
Hi, I've been informed of how exactly to use the CBOR tag solution by the author of one of the cbor.io recommended CBOR libraries: https://github.com/fxamacker/cbor/issues/241#issuecomment-656881180 This solution is clearly a bit nicer than the wrapping struct solution but it's specific to th

[go-nuts] Re: decode unknown CBOR type with set of known types

2020-07-09 Thread David Stainton
> know you've got a `This`. > > (Disclaimer: I know this technique works with the encoding/json package; I > can't guarantee it works with the cbor package you're using because I'm not > familiar with it, > but if it behaves like encoding/json, you should be OK.) &g

[go-nuts] decode unknown CBOR type with set of known types

2020-07-08 Thread David Stainton
Greetings, Similar questions have been asked in the past and I've read those posts... and I believe I'm asking something different here. I'm using length prefixed CBOR over unix domain socket as my wire format. However the reader doesn't known which CBOR type it needs to decode. I'd like a mec