ModPow65537.java revision 809
/*
* Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 4891312
* @summary verify that modPow() not broken by the special case for 65537
* @author Andreas Sterbenz
*/
public class ModPow65537 {
// SunRsaSign uses BigInteger internally
// basic known answer test
BigInteger base = new BigInteger("19058071224156864789844466979330892664777520457048234786139035643344145635582");
BigInteger mod = new BigInteger("75554098474976067521257305210610421240510163914613117319380559667371251381587");
BigInteger res1 = new BigInteger("5770048609366563851320890693196148833634112303472168971638730461010114147506");
BigInteger res2 = new BigInteger("63446979364051087123350579021875958137036620431381329472348116892915461751531");
BigInteger res3 = new BigInteger("39016891919893878823999350081191675846357272199067075794096200770872982089502");
}
}
}
}
byte[] data = new byte[1024];
throw new Exception("signature verification failed");
}
}
}