#include <string.h>
#include <mLib/bits.h>
+#include <mLib/macros.h>
#include <mLib/sub.h>
#include "grand.h"
/* --- Now reduce mod p --- *
*
- * I'm using shifts and adds to do the multiply step here. This needs to
- * be changed if @D@ ever becomes something other than 5.
+ * I'm using shifts and adds to do the multiply step here.
*/
-#if D != 5
-# error "Change shift sequence!"
-#endif
-
{
+ STATIC_ASSERT(D == 5, "Shift sequence doesn't match prime");
uint32 q;
q = yy[1];
static const grand_ops gops = {
"lcrand",
- LCRAND_P, 0,
+ 0, LCRAND_P,
gmisc, gdestroy,
- graw, gbyte, grand_word, grange, grand_fill
+ graw, gbyte, grand_defaultword, grange, grand_defaultfill
};
/* --- @lcrand_create@ --- *