Opened 4 years ago

Last modified 4 years ago

#18413 new defect

BlumGoldwasser Incomplete Inheritance

Reported by: peter.story Owned by:
Priority: major Milestone: sage-6.7
Component: cryptography Keywords:
Cc: kcrisman Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

BlumGoldwasser doesn't properly inherit from its superclass, PublicKeyCryptosystem.

First, initialization is incomplete. The superclass of PublicKeyCryptosystem is Cryptosystem, whose initialization requires the arguments: plaintext_space, ciphertext_space, key_space, block_length, and period. These are not being supplied.

As a result, calls to the methods plaintext_space(), cipher_domain(), ciphertext_space(), cipher_codomain(), key_space(), block_length(), and period() fail. For example:

  sage: from sage.crypto.public_key.blum_goldwasser import BlumGoldwasser
  sage: bs = BlumGoldwasser()
  sage: bs.key_space()
  AttributeError: 'BlumGoldwasser' object has no attribute '_key_space'

The easiest solution would be to stop inheriting from PublicKeyCryptosystem.

Change History (2)

comment:1 Changed 4 years ago by kcrisman

Perhaps a naive question... is there anything else that uses PublicKeyCryptosystem?

comment:2 Changed 4 years ago by peter.story

BlumGoldwasser is actually the only module which uses PublicKeyCryptosystem. So it might be worth removing PublicKeyCryptosystem altogether. PublicKeyCryptosystem is defined on line 375 of crypto/cryptosystem.py.

Note: See TracTickets for help on using tickets.