Bill Allombert on Sun, 26 Nov 2023 20:24:05 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Kunerth's algorithm (determine modular square root of a number)
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: Kunerth's algorithm (determine modular square root of a number)
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sun, 26 Nov 2023 20:23:56 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1701026638; c=relaxed/relaxed; bh=sGfiPxCTygKaAtbwtC6fVS+jQ68wwCLObDsirY9oLnE=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=uGLHcG5oY9xB2zOn+MKh29MEp0J6lA/v3JCmXcND0A++4iRZ4cCpOcG521vZRafn20J4wAzitqN+UjWztcvjByH4xQkc5gGsxr4zbUe+AIF2yG2uZ4uZIKEbbSmBu5uUF/QlLrkGdBInlM2ParBhRmWDh6Vw9Ova/MiIYwIfvWhTwoj9eUcqRsS5EwnU3f1fdncxOjnMT6y+U5ishRC62VafdHuYK1JJ9Cz9mSlvNdqULwstLDBY5/q2+6Q/1samhvpuWNUUuxFsOMvoB6PAcmCGkE5k0wHsb7khPiS49P6h1WACsmf7n5ZPix7XVdwVhLVv9xCogqyzctXT59Ih+s+B7IXAu7k5dIN7W+VrgOuCzSG/PhlFIfmGp45vxH58K3YhiQqT5FAMIghYD9ot98+JmBW8zQLElSo1niN3sTyK3oS+ms6aMUveDNnelarXFUvhjM3jvKsheEwLlhiPPe72j6K/k8LOn+K5UCuR/RzzGmUN7eJIPKE/car4VaqYMaL0vdY7gezD5FIzZw6lbi/F1ceXVdjdej95myAiRD7sIKypo8bNg2tswK4cTSYCKh04nzls2uC28maf+o1wu13orVP/FZW3K1LFDLyDYEuSEgUadN9ldw10V1mKhSPnVuT7KTrxLzKr1/HcmFL6izEZNRizYVMeFlPYLH9R75k=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1701026638; cv=none; b=zXthwl83W5NpFIV7T+Wklq58pwp4iRwu6tSpSeYIvT7ZEhsF8Hp6/mTY7JOYU9OazNmUyruc3SKkUmE5PV23kDgZalWjyYPTILCQ38wDm9uM21pfn0z/rrBuPTn2CNHmaG6GvyRvNtuR+Ye8JhuTwvWUmos57Zy2K+tgkpkDWB3TMZ8cZAXyXlLKaMfMahOsDUdgwdIauclltuQQa3EOe+1pHtuhk7dce1dyy+Q3u2yZaEesObMrttvxRCb7gp/VGQsu2HVvdx5fR5SpfoL9IsYoOYUL1Re43K1MWI0jK0eEltzjcgbhVX8jdSBM3bXv94wB+x3ii9cVy6H2XTd8VkdoQyA5beKd30pmPieI5NAiU1wHiExbiqRYxNXkd9bGlsIEGjbHq6jEgc76bVFcu0E4gHTab6wcekhZ+nSjrHnp12Ygd15DiMp30wNj7lqHSOR0djeazXCvdhYBQrVY/cJnagjhe4uHREj94Dh+xqOccExCRIoE8sJ/tywei5LeHv4EJcRF4n8J4oK23FCYk3YHTF/5FAQdcBE525abg2L4xsbNbSZXWBiC87wzO1/drEyM+t01MZwUqsAr4QTcsYIKFWGuTomK/olwym4d0Shd8N6XBeKo0Hjvh1VRQMWoUHo2swUm1esqX0rBPnhGhbyjVHfvNmfOAc3B4X0JvzY=
- Authentication-results: smail; arc=none
- Delivery-date: Sun, 26 Nov 2023 20:24:05 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1701026638; bh=sGfiPxCTygKaAtbwtC6fVS+jQ68wwCLObDsirY9oLnE=; h=Date:From:To:Subject:References:In-Reply-To:From; b=Tt5GA0YafU6In9Y7Yx+Y5NAZ7p75z8wz5x8EsGYD3yCMsyMWdFlZ5wfUCVG54HNqt aamY3008AVrL4Dqbbn9YTMUYouDMm3TsH2JOz95DIzzVie4adSWUbnP0EUP3kHoWHu d/hM/nldnf7yntwdzDCCmt/Rxniqb1wmeP3ZrJFgYQAK3z8oD9rJ9RYjKTxD+4ZrlJ KBKKzgAa4EkUUiMNijWkilutR8n19QgnDqUpIQFom+WRTGFba+qMBdvat73Ohz+1Cm ZeHSXEWsftoEAeXBhzk9sMQQjEvtmkA9Pc5iLYXM+4cydN6Mapi5CILhLuo/WtzaOP FW5h1f9dWqn3avmjFKbiWnrcSENSX/CMIn9ynHIUd38Hd/7OlUMSWc1vNg78hGECbX H8RMgz0ScjciZovCFwaWdd9LXol2u4nrSe07rVy8gwhIy74WBc1u/hflYe/Uuj6riR UBsr/eRMXMdagV67ZeX9znhS0D6oMbPeuFSk+KcmyY2VyjtN8LeWlILQJcbMUZHNop fWBtC9RzpkJrwte5AnOoZFdMQB6fxSy+GbVcPe5SfgYGDWH7b/WhFT2pYvun6ClDej jQ7NmQK1UDknpk41tCJd+wlmIrascoIInUGi6YCy9SUdiRza+pYQDgu9DmqnCWeCn9 aqelsB/FM3zXOTFXkxcpbpsI=
- In-reply-to: <4367a0f01b523e1ac998865d7a5b14bf@stamm-wilbrandt.de>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <3644907cc7ac8b441895a07ef168f737@stamm-wilbrandt.de> <15c2026104065a9c9a892e8194143af6@stamm-wilbrandt.de> <4367a0f01b523e1ac998865d7a5b14bf@stamm-wilbrandt.de>
On Sat, Nov 25, 2023 at 11:39:19PM +0100, hermann@stamm-wilbrandt.de wrote:
> On 2023-11-25 02:41, hermann@stamm-wilbrandt.de wrote:
> > Tomorrow I will investigate why the 4 examples from Kunerth's 1878 paper
> > do not work for now, and try to fix Kunert.gp and then post here.
> >
> > These are the current failures:
> >
> > *** sqrt: not a prime number in Fl_sqrt [modulus]: 1124.
> > *** sqrt: not a prime number in sqrt [modulus]: 16315.
> > *** at top-level: assert(issquare(w,&W))
> > *** Mod: impossible inverse in Fl_inv: Mod(0, 239).
> >
> > Kunerth's algorithm is not a general purpose modular sqrt algorithm.
> > Will be interesting to see what scenarios can be processed.
> >
> Now in 4th revision you can find Kunerth.gp gist here for playing with:
> https://gist.github.com/Hermann-SW/76e7cf8545c5e8b0332faeaad878e08f
>
> It only works if constant term of quadratic form is a square.
> The Kunerth paper examples show how to deal with non-square constant term.
This seems to work as follow:
Let p a prime number and N an integer, one try to find s so that s^2=p mod N.
The idea is to find a, x, y (with y coprime to N) so that
p*y^2 = x^2 - a*N
then obviously (x/y)^2 = p (mod N).
Apparently the trick is to note that this also implies a*N = x^2 mod p, so
we can reduce the search by computing r = sqrt(a*N) mod p and only search
for x = ±r + z*p which leads to
p*y^2 = (±r+z*p)^2 - a*N
I suppose, the hope is that z will be easier to find than x.
Cheers,
Bill.