Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails on i386 #127

Closed
nunotexbsd opened this issue Sep 25, 2022 · 4 comments
Closed

build fails on i386 #127

nunotexbsd opened this issue Sep 25, 2022 · 4 comments

Comments

@nunotexbsd
Copy link

1.30 fails to build on i386 arch:

Picocrypt.go:53:11: cannot use 1 << 40 (untyped int constant 1099511627776) as int value in variable declaration (overflows)

Picocrypt FreeBSD port 1.25 builds fine, any hints?

Thanks

@HACKERALERT
Copy link
Owner

HACKERALERT commented Sep 25, 2022

Ah, 32-bit systems aren't supported by Picocrypt. As a quick explanation, integers in Go are by default the number of bits of the system. So on 32-bit systems, Go's integers are 32-bit. In the error message, 1<<40 is a 40-bit number, which is greater than the 32-bit support, so it fails to build, hence the message about overflows. There's no obvious solution other than to use a 64-bit system since 40 bits is less than 64 bits.

If you insist on a solution, however, a hacky one would be to replace 1<<40 with 1<<30 on line 53. Doing this would break the file splitting feature for files greater than 1 TiB, but it's unlikely you'll be encrypting more than 1 TiB of data, so it is a reasonable compromise. But this also introduces undefined behaviour when encrypting more than 4 GiB (2^32) of data. tl;dr: Picocrypt is 64-bit only.

Let me know if that helps!

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Sep 25, 2022
@nunotexbsd
Copy link
Author

Hello,

Thanks for explanation, I will mark this port only for 64-bit archs.

Cheers

@HACKERALERT
Copy link
Owner

Awesome, thank you so much for updating the port! Glad to see it on the latest release again.

@Benson665
Copy link

It's my pleasure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants