Commit 54def794 authored by Niels Möller's avatar Niels Möller

* macros.h (FOR_BLOCKS): New macro, taken from lsh.

Rev: src/nettle/macros.h:1.2
parent e09706b4
...@@ -55,5 +55,11 @@ do { \ ...@@ -55,5 +55,11 @@ do { \
(p)[0] = (i) & 0xff; \ (p)[0] = (i) & 0xff; \
} while(0) } while(0)
/* Macro to make it easier to loop over several blocks. */
#define FOR_BLOCKS(length, dst, src, blocksize) \
assert( !((length) % (blocksize))); \
for (; (length); ((length) -= (blocksize), \
(dst) += (blocksize), \
(src) += (blocksize)) )
#endif /* NETTLE_MACROS_H_INCLUDED */ #endif /* NETTLE_MACROS_H_INCLUDED */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment