castto
[Thread Prev] | [Thread Next]
[Date Prev] | [Date Next]
- Subject: castto
- From: Daniel Cegiełka <daniel.cegielka@xxxxxxxxx>
- Date: Tue, 25 Nov 2014 22:55:22 +0100
- To: myrddin-dev@xxxxxxxxxxxxxx
It seems that 'castto' in Go way is much more readable and compact: /* myrdin */ j0 = (c[0] castto(uint32)) j0 |= (c[1] castto(uint32)) << 8 j0 |= (c[2] castto(uint32)) << 16 j0 |= (c[3] castto(uint32)) << 24 // Go j0 = uint32(c[0]) j0 |= uint32(c[1]) << 8 j0 |= uint32(c[2]) << 16 j0 |= uint32(c[3]) << 24 /* myrdin */ out[0] = x0 castto(byte) out[1] = (x0 >> 8) castto(byte) out[2] = (x0 >> 16) castto(byte) out[3] = (x0 >> 24) castto(byte) // Go out[0] = byte(x0) out[1] = byte(x0 >> 8) out[2] = byte(x0 >> 16) out[3] = byte(x0 >> 24) btw. code from libcrypto/chacha20.myr... still incomplete :) Daniel
Re: castto | Ori Bernstein <ori@xxxxxxxxxxxxxx> |
Re: castto | Ori Bernstein <ori@xxxxxxxxxxxxxx> |
- Next by Date: Re: castto
- Next by thread: Re: castto
- Index(es):