Function
xor
(api: &mut impl RootAPI<C>, a: Vec<Variable>, b: Vec<Variable>)
Source from the content-addressed store, hash-verified
| 133 | } |
| 134 | |
| 135 | fn xor<C: Config>(api: &mut impl RootAPI<C>, a: Vec<Variable>, b: Vec<Variable>) -> Vec<Variable> { |
| 136 | let nbits = a.len(); |
| 137 | let mut bits_res = vec![api.constant(0); nbits]; |
| 138 | for i in 0..nbits { |
| 139 | bits_res[i] = api.add(a[i].clone(), b[i].clone()); |
| 140 | } |
| 141 | bits_res |
| 142 | } |
| 143 | |
| 144 | fn and<C: Config>(api: &mut impl RootAPI<C>, a: Vec<Variable>, b: Vec<Variable>) -> Vec<Variable> { |
| 145 | let nbits = a.len(); |
Tested by
no test coverage detected