tink-crypto / tink-go

Go implementation of Tink
https://developers.google.com/tink
Apache License 2.0
113 stars 5 forks source link

Are 32-bit architectures supported? #19

Closed dottedmag closed 3 months ago

dottedmag commented 5 months ago

Describe the bug:

Trying to build Tink on 32-bit platforms (upstream Go 386 or tinygo wasm) fails:

% cat main.go
package main

import (
    "github.com/tink-crypto/tink-go/v2/aead"
)

func main() {
    aead.New(nil)
}
% GOOS=linux GOARCH=386 go build .
# github.com/tink-crypto/tink-go/v2/aead
../../../go/pkg/mod/github.com/tink-crypto/tink-go/v2@v2.1.0/aead/kms_envelope_aead.go:110:25: maxUint32Size (untyped int constant 4294967295) overflows int

What was the expected behavior?

% GOOS=linux GOARCH=386 go build .
%

What version of Tink are you using?

2.1.0

Is there anything else you'd like to add?

I haven't found a list of supported architectures anywhere in Tink documentation or source code.

dottedmag commented 5 months ago

Also upstream Go is going to have 32-bit WebAssembly architecture, so this is not a theoretical issue: https://github.com/golang/go/issues/63131

juergw commented 4 months ago

Thank you for bringing this up. Yes, we should certainly clarify this. I will add this to https://developers.google.com/tink/, and to the github.

We are only developing and testing on 64-bit architectures. So we don't even know what our code does on 32-bit architectures, and we can't give any guarantees. Making sure that all the code works correctly without any security problems on 32-bit would be a bigger effort, and we currently don't have any capacity to take on this project. I'm sorry.

juergw commented 3 months ago

I added this to the FAQ:

https://developers.google.com/tink/faq/support_for_32bit