(a, b Bits)
| 132 | } |
| 133 | |
| 134 | func Or(a, b Bits) Bits { |
| 135 | if b.IsZero() { |
| 136 | return a |
| 137 | } |
| 138 | if a.IsZero() { |
| 139 | return b |
| 140 | } |
| 141 | if a.Len() != b.Len() { |
| 142 | panic("or'ing two different length bool vectors") |
| 143 | } |
| 144 | out := NewFalse(a.Len()) |
| 145 | for i := range len(a.bits) { |
| 146 | out.bits[i] = a.bits[i] | b.bits[i] |
| 147 | } |
| 148 | return out |
| 149 | } |
| 150 | |
| 151 | func And(a, b Bits) Bits { |
| 152 | if a.IsZero() || b.IsZero() { |