public Polynomial modPow( BigInteger e, Polynomial m ) {

		Polynomial result = Polynomial.ONE;
		Polynomial b = new Polynomial( this );

		while ( e.bitCount() != 0 ) {
			if ( e.testBit( 0 ) ) {
				result = result.multiply( b ).mod( m );
			}
			e = e.shiftRight( 1 );
			b = b.multiply( b ).mod( m );
		}

		return result;
	}