[go-nuts] SHA256 with input not aligned to x8 bit

2019-04-14 Thread Paolo C.
SHA256 (SHA in general) has a precise behavior if you wanna hash a number of bits not multiple of the block (512bit) Sha256.go handle this correcty ONLY in the case that you input is at least multiple of 8 bits. If you wanna hash, say, 20bit (0xABCDE) you cannot obtain a correct result. Note that

Re: [go-nuts] SHA256 with input not aligned to x8 bit

2019-04-15 Thread Paolo C.
} > return sha256.Sum256(b1) > } > > Note that the code above is almost untested, and there are probably more > standard ways to do it - that was just the first thing that came into my > head. > > cheers, > rog. > > On Sun, 14 Apr

[go-nuts] Math.big issue

2021-07-11 Thread Paolo C.
I think there is something wrong in big.Int Exp method. This code: func TestExp(t *testing.T) { p := big.NewInt(5147) ab = big.NewInt(5146 + 5147) t.Logf("ab=%d", ab) ab.Mod(ab, p) t.Logf("ab=%d", ab) c := big.NewInt() c_pow_ab := new(big.Int).Exp(c, ab, p) t.Lo

[go-nuts] SHA3 SHAKE on not byte aligned inupt

2022-04-16 Thread Paolo C.
As for SHA256/512, the SHAKE (and SHA3 in general) go implementation continues to be not fully in line with the RFCs/specification, because there is no way to have a HASH/SUM/MAC of inputs that are not aligned to the byte. Say, for example, 12 bits. Of course, padding before hashing cannot be th

[go-nuts] Golang and virustotal

2022-04-29 Thread Paolo C.
Hello, I noticed that if you download golang portable zip for aMD64 and upload the go.exe or gofnt.exe to virustotal one av complains. If you compile a simple helloword main and upload, 4 or 5 minor av complain. Anyone has this issue too? I tested this from many machines, some completely virgin, so

Re: [go-nuts] Golang and virustotal

2022-04-29 Thread Paolo C.
, that can be sometimes necessary in production, are seen as infected, even if by false positive, this is for sure a deterrent. Don't you think? Paolo On Friday, April 29, 2022 at 12:34:16 PM UTC+2 Rob 'Commander' Pike wrote: > https://go.dev/doc/faq#virus > > On Fri, Apr 2