Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test utility functions to read & process NIST vector files #29

Merged
merged 1 commit into from
Aug 9, 2013

Conversation

dstufft
Copy link
Member

@dstufft dstufft commented Aug 9, 2013

No description provided.



def load_nist_vectors_from_file(base, filename, op, fields):
with open(os.path.join(base, filename), "r") as vector_file:
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason for base to be an argument ant not automatic?

Copy link
Member Author

Choose a reason for hiding this comment

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

It makes calling simpler when using it in the test libraries, because you can do something like functools.partial(load_nist_vectors_from_file, NIST_VECTORS_DIR) and then from there on out jsut pass in the filenames, op, and fields instead of needing to repeat the vectors directory over and over.

Copy link
Member Author

Choose a reason for hiding this comment

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

Alternative is just assuming the base directory in this function. I could do that, it felt cleaner this way but I'm happy either way.

Copy link
Member

Choose a reason for hiding this comment

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

I guess I don't have a strong opinion.

Copy link
Member Author

Choose a reason for hiding this comment

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

If we assume the base directory it becomes simpler to call it (no need to use functools) so I guess it makes sense to do that.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 9e1a48b on dstufft:nist-vector-file-utilities into 4bc4519 on alex:master.

alex added a commit that referenced this pull request Aug 9, 2013
Add a test utility functions to read & process NIST vector files
@alex alex merged commit 80bb237 into pyca:master Aug 9, 2013
@dstufft dstufft deleted the nist-vector-file-utilities branch August 9, 2013 05:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants