}
return x;
}
-
+uint64_t bmatand(uint64_t RA, uint64_t RB)
+{
+ // transpose of RB
+ uint64_t RBt = bmatflip(RB);
+ uint8_t u[8]; // rows of RA
+ uint8_t v[8]; // cols of RB
+ for (int i = 0; i < 8; i++) {
+ u[i] = RA >> (i*8);
+ v[i] = RBt >> (i*8);
+ }
+ uint64_t x = 0;
+ for (int i = 0; i < 64; i++) {
+ if ((u[i / 8] & v[i % 8]) == 0xff)
+ x |= 1LL << i;
+ }
+ return x;
+}
```
# Introduction to Carry-less and GF arithmetic