Decrypts information for ``RNS.Destination.SINGLE`` or ``RNS.Destination.GROUP`` type destination. :param ciphertext: *Bytes* containing the ciphertext to be decrypted. :raises: ``ValueError`` if destination does not hold a necessary key for decryption. */ virtual*/
| 488 | :raises: ``ValueError`` if destination does not hold a necessary key for decryption. |
| 489 | */ |
| 490 | /*virtual*/ const Bytes Destination::decrypt(const Bytes& data) { |
| 491 | assert(_object); |
| 492 | TRACE("Destination::decrypt: decrypting data..."); |
| 493 | |
| 494 | if (_object->_type == PLAIN) { |
| 495 | return data; |
| 496 | } |
| 497 | |
| 498 | if (_object->_type == SINGLE && _object->_identity) { |
| 499 | return _object->_identity.decrypt(data); |
| 500 | } |
| 501 | |
| 502 | /* |
| 503 | if (_object->_type == GROUP) { |
| 504 | if hasattr(self, "prv") and self.prv != None: |
| 505 | try: |
| 506 | return self.prv.decrypt(ciphertext) |
| 507 | except Exception as e: |
| 508 | RNS.log("The GROUP destination could not decrypt data", RNS.LOG_ERROR) |
| 509 | RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR) |
| 510 | else: |
| 511 | raise ValueError("No private key held by GROUP destination. Did you create or load one?") |
| 512 | } |
| 513 | */ |
| 514 | // MOCK |
| 515 | return {Bytes::NONE}; |
| 516 | } |
| 517 | |
| 518 | /* |
| 519 | Signs information for ``RNS.Destination.SINGLE`` type destination. |
nothing calls this directly
no outgoing calls
no test coverage detected