MCPcopy Create free account
hub / github.com/docknetwork/crypto / polynomial

Function polynomial

compressed_sigma/src/partial_knowledge.rs:391–413  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

389
390 #[test]
391 fn polynomial() {
392 fn check_poly(x: Vec<Fr>) {
393 let p = create_poly(x.clone());
394 assert_eq!(p.degree(), x.len());
395 assert_eq!(p.evaluate(&Fr::zero()), Fr::one());
396 for x in x.iter() {
397 assert_eq!(p.evaluate(x), Fr::zero());
398 }
399 }
400
401 let x1 = vec![Fr::from(3u64), Fr::from(4u64), Fr::from(5u64)];
402 let x2 = vec![
403 Fr::from(1u64),
404 Fr::from(3u64),
405 Fr::from(5u64),
406 Fr::from(6u64),
407 Fr::from(9u64),
408 ];
409 let x3 = vec![Fr::from(4u64)];
410 check_poly(x1);
411 check_poly(x2);
412 check_poly(x3);
413 }
414
415 #[test]
416 fn create_homomorphisms() {

Callers

nothing calls this directly

Calls 1

check_polyFunction · 0.85

Tested by

no test coverage detected