[Python-Dev] Patch reviews

Nick Coghlan ncoghlan at gmail.com
Sun Sep 4 11:48:24 EDT 2016


On 4 September 2016 at 20:57, Christian Heimes <christian at python.org> wrote:
> On 2016-09-01 23:15, Victor Stinner wrote:
>> 2016-08-31 22:31 GMT+02:00 Christian Heimes <christian at python.org>:
>>> https://bugs.python.org/issue27744
>>> Add AF_ALG (Linux Kernel crypto) to socket module
>>
>> This patch adds a new socket.sendmsg_afalg() method on Linux.
>>
>> "afalg" comes from AF_ALG which means "Address Family Algorithm". It's
>> documented as "af_alg: User-space algorithm interface" in
>> crypto/af_alg.c.
>>
>> IHMO the method should be just "sendmsg_alg()", beacuse "afalg" is
>> redundant. The AF_ prefix is only used to workaround a C limitation:
>> there is no namespace in the language, all symbols are in one single
>> giant namespace.
>>
>> I don't expect that a platform will add a new sendmsg_alg() C
>> function. If it's the case, we will see how to handle the name
>> conflict ;-)
>
> Hi,
>
> afalg is pretty much the standard name for Linux Kernel crypto. For
> example OpenSSL 1.1.0 introduced a crypto engine to offload AES. The
> engine is called 'afalg' [1]. Other documentations refer to the
> interface as either afalg or AF_ALG, too. I prefer to use an established
> name for the method.

Right, there's a confusability problem here not just at the API level,
but at a general terminology level: "alg" is just short for
"algorithm", which is way to generic to be meaningful. Once you put
the "af" qualifier in front though, it's clear you're not just talking
about algorithms in general, you're referring to AF_ALG in particular.

Putting the alternatives into Google and seeing which one gives more
relevant results also suggests afalg as the clear winner, since the
first link returned is the OpenSSL engine for it, while even
qualifying "alg" with "ssl" doesn't get you relevant information:

* https://www.google.com.au/search?q=afalg
* https://www.google.com.au/search?q=alg
* https://www.google.com.au/search?q=alg#q=alg+ssl

(that afalg repo unfortunately doesn't have a useful README, but at
least the first link is relevant, unlike the results for "alg" and
"alg ssl")

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list