[PYTHON-CRYPTO] Package name

M.-A. Lemburg mal at LEMBURG.COM
Mon Nov 26 11:21:06 CET 2001


> [Auto-Configuration of Crypto Drivers]
>
> > > > Simple: just install the extensions in a well-known directory and
> > > > then have the API scan that directory for .py[c|o] files. Works
> > > > great ! Plug&Play sort-of :-)
> > >
> > > What to do if two packages A and B are both implementing algorithm c
> > > ?
> >
> > There are multiple options:
> > 1. first one found wins
>
> Very bad.

That's the way Python imports have always worked -- can't be that bad ;-)
This is also, what the codec lookup mechanism implements.

> > 2. raise an exception
>
> Also makes no sense to me.

Why not ? That way the user will know that there's a problem
and that she'll have to fix it according to her own preferences.

> > 3. the registration API of each package defines a preference
> >    level and the one with the highest preference value wins (usually
> >    the fastest implementation)
>
> How to maintain a preference level? Who is going to maintain the
> preference level? How to value preference (e.g. speed vs. security)?

We'd define preference levels for various aspects of the implementation,
the driver writer would use these values and provide constants to the
auto-registration mechanism and the user would choose by passing
the intended levels to the lookup API.

> I'm more in favour of a deterministic configuration scheme.

An alternative mechanism would be to make imports explicit;
the user will then have to explicitly set the driver for the
rest of the crypto API to use. This loses the automatic setup
aspect, though.

Personally, I don't really care, because I'd most probably
go with an OpenSSL-based crypto driver (that's what I've done
in the past and most probably will do in the future ;-).

--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/





More information about the python-crypto mailing list