Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Remove Python < 2.6 support #84

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

mitchellrj
Copy link
Contributor

Includes #81.

@mitchellrj mitchellrj mentioned this pull request Apr 29, 2014
@@ -305,7 +303,7 @@ def _ignite(self, data):
if self._mac:
raise TypeError("_ignite() cannot be called twice")

self._buffer.insert(0, data)
self._buffer.insert(0, bstr(data))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data is already supposed to be a byte string here. Adding bstr is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from #81. The bstr is necessary to convert the data for the CMAC if a bytearray was input.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change to the API then: CMAC.update() is defined as taking a byte string only, not a byte array. I find this belongs to a separate change set: this PR is about removing support for Python<2.6 (and adding support for buffers in the process).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't make myself clear. This ensures that any input given to the block cipher is passed to the CMAC as bytes rather than in its given form. It does not alter what CMAC can accept.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the block cipher methods update, encrypt and decrypt (which currently feed CMAC in EAX mode) are currently defined as accepting byte strings too, not bytearrays. This change still does not belong here (not to say it is not an improvement, just noting that it changes the API, and if it does there should be unit tests and such).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well yes, it's part of #81 on which this pull is based. The purpose of that pull is to allow buffer/bytearray use with all block cipher methods and hash methods. There are unit tests covering these uses: see below. Perhaps we should deal with #81 and rebase this pull before getting into specifics.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants