  In this paper we present a polynomial time algorithm to compute the local
zeta function Z(s,f) attached to a polynomial f(x) in Z[x] (in one variable,
with splitting field Q) and a prime p. The algorithm reduces in polynomial time
the computation of Z(s,f) to the computation of a factorization of f(x) over Q.
This reduction is accomplished by constructing a weighted tree from the p-adic
expansion of the roots of f(x) modulo a certain power of p, and then
associating a generating function to this tree. The generating function
constructed in this way coincides with the local zeta function of f(x). We also
propose a new class of candidates for one-way functions based on Igusa's zeta
functions attached to polynomials in one variable.
