testing script with examples

Test suite containing functional unit tests of exported functions. Click on a [source] link beside any test method to view the examples found in that particular test.

class TestKeys[source]

Bases: TestCase

Tests of methods of cryptographic key classes.

test_key_operations_for_store()[source]

Test key generate, dump, JSONify, and load for the store operation.

test_key_operations_for_match()[source]

Test key generate, dump, JSONify, and load methods for the match operation.

test_key_operations_for_sum_with_single_node()[source]

Test key generate, dump, JSONify, and load methods for the sum operation with a single node.

test_key_operations_for_sum_with_multiple_nodes()[source]

Test key generate, dump, JSONify, and load methods for the sum operation with multiple (without/with threshold) nodes.

test_secret_key_from_seed_for_store()[source]

Test key generation from seed for the store operation both with a single node and multiple (without/with threshold) nodes.

test_secret_key_from_seed_for_match()[source]

Test key generation from seed for the match operation with a single node.

test_secret_key_from_seed_for_sum_with_multiple_nodes()[source]

Test key generation from seed for the sum operation with multiple (without/with a threshold) nodes.

class TestKeysError[source]

Bases: TestCase

Tests of errors raised by methods of cryptographic key classes.

test_key_generation_errors()[source]

Test errors that can occur during key generation.

test_key_dumping_and_loading_errors()[source]

Test errors that can occur during key dumping and loading (excluding the errors that can occur due to checks performed within key generation methods).

class TestFunctions[source]

Bases: TestCase

Tests of the functional and algebraic properties of encryption/decryption functions.

test_encrypt_decrypt_for_store()[source]

Test encryption and decryption for the store operation with single/multiple nodes and without/with threshold (including subcluster combinations).

test_encrypt_for_match()[source]

Test encryption for the match operation.

test_encrypt_decrypt_for_sum_with_single_node()[source]

Test encryption and decryption for the sum operation with a single node using a public key.

test_encrypt_decrypt_for_sum_with_multiple_nodes()[source]

Test encryption and decryption for the sum operation with single/multiple nodes and without/with threshold (including subcluster combinations).

class TestRepresentations[source]

Bases: TestCase

Tests the portability and compatibility of key and ciphertext representations.

test_representations_for_store_with_single_node()[source]

Confirm ability to handle representation of keys and ciphertexts for storage in a single-node cluster.

test_representations_for_store_with_multiple_nodes()[source]

Confirm ability to handle representation of keys and ciphertexts for storage in a multiple-node cluster.

test_representations_for_store_with_multiple_nodes_with_threshold()[source]

Confirm ability to handle representation of keys and ciphertexts for storage (with threshold) in a multiple-node cluster.

test_representations_for_sum_with_single_node()[source]

Confirm ability to handle representation of keys and ciphertexts for summation (with threshold) in a single-node cluster.

test_representations_for_sum_with_multiple_nodes()[source]

Confirm ability to handle representation of keys and ciphertexts for summation in a multiple-node cluster.

test_representations_for_sum_with_multiple_nodes_with_threshold()[source]

Confirm ability to handle representation of keys and ciphertexts for summation (with threshold) in a multiple-node cluster.

class TestCiphertextSizes[source]

Bases: TestCase

Tests that ciphertext sizes conform to known closed formulas.

test_ciphertext_sizes_for_store()[source]

Confirm that ciphertexts compatible with the storage operation have the expected sizes.

test_ciphertext_sizes_for_match()[source]

Confirm that ciphertexts compatible with the match operation have the expected sizes.

test_ciphertext_sizes_for_sum()[source]

Confirm that ciphertexts compatible with the sum operation have the expected sizes.

class TestFunctionsErrors[source]

Bases: TestCase

Tests verifying that encryption/decryption methods return expected errors.

test_encrypt_errors()[source]

Test errors that can occur during encryption.

test_decrypt_errors_invalid_key()[source]

Test errors that can occur during decryption with an invalid key.

test_decrypt_errors_key_ciphertext_conflict()[source]

Test errors that can occur during decryption when the key and ciphertext conflict.

test_decrypt_errors_invalid_ciphertext()[source]

Test errors that can occur during decryption when the ciphertext is invalid.

class TestSecureComputations[source]

Bases: TestCase

Tests consisting of end-to-end workflows involving secure computation.

test_workflow_for_secure_sum_mul_with_single_node()[source]

Test secure summation workflow with a cluster that has a single node.

test_workflow_for_secure_sum_mul_with_multiple_nodes()[source]

Test secure summation workflow with a cluster that has multiple nodes.

test_workflow_for_secure_sum_mul_with_multiple_nodes_with_threshold()[source]

Test secure summation workflow with a cluster that has multiple nodes (with a threshold).

class TestDocumentFunctions[source]

Bases: TestCase

Test allotment/unification functions for working with secret-shared documents.

test_allot()[source]

Check that a document is converted correctly into secret shares.

test_unify()[source]

Check that document secret shares are unified correctly into a single document.