We give polynomial time attacks on the McEliece public key cryptosystem based
either on algebraic geometry (AG) codes or on small codimensional subcodes of
AG codes. These attacks consist in the blind reconstruction either of an Error
Correcting Pair (ECP), or an Error Correcting Array (ECA) from the single data
of an arbitrary generator matrix of a code. An ECP provides a decoding
algorithm that corrects up to 2d∗−1−g errors, where d∗ denotes
the designed distance and g denotes the genus of the corresponding curve,
while with an ECA the decoding algorithm corrects up to 2d∗−1
errors. Roughly speaking, for a public code of length n over Fq,
these attacks run in O(n4log(n)) operations in Fq for the
reconstruction of an ECP and O(n5) operations for the reconstruction of an
ECA. A probabilistic shortcut allows to reduce the complexities respectively to
O(n3+εlog(n)) and O(n4+ε). Compared to the
previous known attack due to Faure and Minder, our attack is efficient on codes
from curves of arbitrary genus. Furthermore, we investigate how far these
methods apply to subcodes of AG codes.Comment: A part of the material of this article has been published at the
conferences ISIT 2014 with title "A polynomial time attack against AG code
based PKC" and 4ICMCTA with title "Crypt. of PKC that use subcodes of AG
codes". This long version includes detailed proofs and new results: the
proceedings articles only considered the reconstruction of ECP while we
discuss here the reconstruction of EC