svn commit: r336721 - in head/net-p2p/litecoin: . files

Andrey Chernov ache at freebsd.org
Tue Dec 17 20:28:48 UTC 2013


On 17.12.2013 17:10, Steve Wills wrote:
> Author: swills
> Date: Tue Dec 17 13:10:02 2013
> New Revision: 336721
> URL: http://svnweb.freebsd.org/changeset/ports/336721
> 
> Log:
>   - Update to 0.8.6.1
> 
> Added:
>   head/net-p2p/litecoin/files/extra-patch-endian   (contents, props changed)

Why you decide to add the same functions as in
/usr/include/sys/endian.h
instead of just including it?

> +-static inline uint32_t be32dec(const void *pp)
> +-{
> +-	const uint8_t *p = (uint8_t const *)pp;
> +-	return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
> +-	    ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
> +-}
> +-
> +-static inline void be32enc(void *pp, uint32_t x)
> +-{
> +-	uint8_t *p = (uint8_t *)pp;
> +-	p[3] = x & 0xff;
> +-	p[2] = (x >> 8) & 0xff;
> +-	p[1] = (x >> 16) & 0xff;
> +-	p[0] = (x >> 24) & 0xff;
> +-}
> +-
> + typedef struct HMAC_SHA256Context {
> + 	SHA256_CTX ictx;
> + 	SHA256_CTX octx;
> +--- src/scrypt.h.orig	2013-12-09 15:26:17.343282984 +0000
> ++++ src/scrypt.h	2013-12-09 15:45:11.032205545 +0000
> +@@ -17,19 +17,4 @@
> + PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, const uint8_t *salt,
> +     size_t saltlen, uint64_t c, uint8_t *buf, size_t dkLen);
> + 
> +-static inline uint32_t le32dec(const void *pp)
> +-{
> +-        const uint8_t *p = (uint8_t const *)pp;
> +-        return ((uint32_t)(p[0]) + ((uint32_t)(p[1]) << 8) +
> +-            ((uint32_t)(p[2]) << 16) + ((uint32_t)(p[3]) << 24));
> +-}
> +-
> +-static inline void le32enc(void *pp, uint32_t x)
> +-{
> +-        uint8_t *p = (uint8_t *)pp;
> +-        p[0] = x & 0xff;
> +-        p[1] = (x >> 8) & 0xff;
> +-        p[2] = (x >> 16) & 0xff;
> +-        p[3] = (x >> 24) & 0xff;
> +-}
> + #endif
> 



More information about the svn-ports-head mailing list