check if iterators have the same size in multiscalar mul (#494)

This commit is contained in:
Conrado Gouvea 2023-08-28 13:20:14 -03:00 committed by GitHub
parent 60d9942f36
commit f3fd9102a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -195,6 +195,10 @@ where
.map(|P_opt| P_opt.map(|P| LookupTable5::<C, Element<C>>::from(&P)))
.collect::<Option<Vec<_>>>()?;
if nafs.len() != lookup_tables.len() {
return None;
}
let mut r = <C::Group>::identity();
// All NAFs will have the same size, so get it from the first