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

Update pycrypto to 2.6.1 #14854

Closed
jpflori opened this issue Jul 4, 2013 · 26 comments
Closed

Update pycrypto to 2.6.1 #14854

jpflori opened this issue Jul 4, 2013 · 26 comments

Comments

@jpflori
Copy link
Contributor

jpflori commented Jul 4, 2013

We ship 2.1.0.

Use git branch and upstream tarball at:

Depends on #12399

Component: packages: standard

Keywords: spkg pycrypto

Author: Jean-Pierre Flori

Branch/Commit: u/jpflori/ticket/14854 @ 83eeb4b

Reviewer: Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/14854

@jpflori
Copy link
Contributor Author

jpflori commented Jul 4, 2013

Changed keywords from none to spkg pycrypto

@jpflori
Copy link
Contributor Author

jpflori commented Jul 4, 2013

comment:1

This would be a good time to cleanup spkg scripts.

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

Branch: u/jpflori/ticket/14854

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

comment:2

Trivial update on top of #12399.


New commits:

e0fbe47Update PyCrypto to version 2.6.1.
528d988Let PyCrypto build on FreeBSD.

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

Commit: e0fbe47

@jpflori

This comment has been minimized.

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

Author: Jean-Pierre Flori

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

Dependencies: #12399

@jpflori jpflori changed the title Update pycrypto to 2.6.0 Update pycrypto to 2.6.1 Dec 25, 2013
@vbraun
Copy link
Member

vbraun commented Dec 25, 2013

comment:4

This was in #15531 but I'm pretty sure it applies here just as well:

sage -t --long src/sage/crypto/block_cipher/miniaes.py  # 1 doctest failed
sage -t --long src/sage/crypto/block_cipher/sdes.py  # 1 doctest failed
sage -t --long src/sage/crypto/classical_cipher.py  # 1 doctest failed
sage -t --long src/sage/crypto/stream_cipher.py  # 1 doctest failed
sage -t --long src/sage/crypto/util.py  # 1 doctest failed
sage -t --long src/sage/crypto/public_key/blum_goldwasser.py  # 1 doctest failed
sage -t --long src/sage/monoids/string_monoid.py  # 1 doctest failed
sage -t --long src/sage/monoids/string_monoid_element.py  # 1 doctest failed

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

comment:5

Oops, I'll have a look at it.

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

comment:6

The errors are because pycrpto wants a secure (hum, let's say more side channel attacks resistant) implem of modular exponentiation or issues a warning.
It's available as mpz_powm_sec from recent GMP releases, but MPIR does not supply that.
(Also note that wiith FLINT 2.4 we should be able to build all of Sage IIRC on top of gmp, time for a new spkg?)
So we should just ignore the warnings (or add them to the doctests but would fail with Sage on top of GMP).
Anyway, we don't really care within Sage, at least that's my point of view, nobody would or should use Sage to do real crypto.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 25, 2013

Changed commit from e0fbe47 to a76e9a3

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 25, 2013

Branch pushed to git repo; I updated commit sha1. New commits:

a76e9a3Filter pycrypto warning about insecure modular exponentiaiton.

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

comment:8

The solution I've implemented is to filter pycrypto warnings in the warnings module.
Feel free to say it is a bad solution and we should rather modify the tests, or move the piece of code I've added somewhere else (maybe it really slows down Sage startup, I don't know).

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

comment:9

On a different topic, the only funciton actually used is in the monoids files, and that's only the byte_to_long function, so maybe we should implement this ourselves.
I don't suggest to remove the pycrypto pkg though.

@vbraun
Copy link
Member

vbraun commented Dec 25, 2013

comment:10

I'd rather modify the tests and preserve the warning...

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

comment:11

Should we explicitely match the warning or filter it with "..."?

@vbraun
Copy link
Member

vbraun commented Dec 25, 2013

comment:12

Explicit is better than implicit (one of Python's credos), but then I don't care that much ;-)

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

comment:13

Let's go for explicit. As I said, I think we should get rid of the pycrypto use in the monoid stuff anyway, so when that's the case it will force us to remove the explicit things rather than leaving ... evrywhere.

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

comment:14

Unfortunately I'm not sure I can do anything else as what I did as the warning only comes up the first time the BinaryStrings().encoding("") is used so it depends on the order the tests within the file will be run.

Maybe better reimplement bytes_to_long and long_to_bytes directly.

@vbraun
Copy link
Member

vbraun commented Dec 25, 2013

comment:15

The order of doctests is top to bottom, isn't it?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 25, 2013

Changed commit from a76e9a3 to 83eeb4b

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 25, 2013

Branch pushed to git repo; I updated commit sha1. New commits:

83eeb4bReplace bytes_to_long/long_to_bytes by ord/chr.
706b4feRevert "Filter pycrypto warning about insecure modular exponentiaiton."

@jpflori
Copy link
Contributor Author

jpflori commented Dec 25, 2013

comment:17

I've replaced the pycrypto functions by plain python funcitons which seem to be adequate for our use.

@vbraun
Copy link
Member

vbraun commented Dec 26, 2013

comment:18

lgtm

@vbraun
Copy link
Member

vbraun commented Dec 26, 2013

Reviewer: Volker Braun

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

No branches or pull requests

3 participants