Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomized testing failure: EC Add G2 #65

Closed
mratsim opened this issue Jun 20, 2020 · 2 comments · Fixed by #58
Closed

Randomized testing failure: EC Add G2 #65

mratsim opened this issue Jun 20, 2020 · 2 comments · Fixed by #58
Labels
bug 🪲 Something isn't working has repro 🎯

Comments

@mratsim
Copy link
Owner

mratsim commented Jun 20, 2020

For BLS12-381, seed 1592673796, commit 89c78ef like #62 (but different seed for the life of me I can't find the original CI trigger)

image

Repro with -d:Constantine32

import
  # Standard library
  std/[unittest, times],
  # Internals
  ../constantine/config/[common, curves],
  ../constantine/[arithmetic, towers],
  ../constantine/io/[io_bigints, io_fields, io_towers],
  ../constantine/elliptic/[ec_weierstrass_affine, ec_weierstrass_projective]

proc trySetFromCoordsXandZ_debug*[F](P: var ECP_SWei_Proj[F], x, z: F): SecretBool =
  ## Try to create a point the elliptic curve
  ## Y²Z = X³ + aXZ² + bZ³ (projective coordinates)
  ## y² = x³ + a x + b     (affine coordinate)
  ## return true and update `P` if `x` leads to a valid point
  ## return false otherwise, in that case `P` is undefined.
  ##
  ## Note: Dedicated robust procedures for hashing-to-curve
  ##       will be provided, this is intended for testing purposes.
  P.y.curve_eq_rhs(x)

  echo "P.y: ", P.y.toHex()
  echo "P.y.isSquare: ", bool P.y.isSquare
  result = sqrt_if_square(P.y)
  echo "P.y.wasSquare: ", bool result

  P.x.prod(x, z)
  P.y *= z
  P.z = z

var a, b, c: ECP_SWei_Proj[Fp2[BLS12_381]]

var ax, az, bx, bz, cx, cz: Fp2[BLS12_381]
ax.fromHex(
  c0 = "0x13d97382a3e097623d191172ec2972f3a4b436e24ae18f8394c9103a37c43b2747d5f7c597eff7bda406000000017ffd",
  c1 = "0x11eca90d537eabf01ead08dce5d4f63822941ce7255cc7bfc62483dceb5d148f23f7bfcaeb7f5ffccd767ff5ffffdffe"
)

az.fromHex(
  c0 = "0x15f65ec3fa7ce4935c071a97a256ec6d77ce385370513744df48944613b748b2a8e3bfdb035bfb7a7608ffc00002ff7c",
  c1 = "0x15f646c3fa80e4835bd70a57a196ac6d57ce1653705247455f48983753c758bae9f3800ba3ebeff024c8cbd78002fdfc"
)

bx.fromHex(
  c0 = "0x146e5ab3ea40d392d3868086a256ec2d524ce85345c237434ec0904f52d753b1ebf4000bc40c00026607fc000002fffc",
  c1 = "0x15f65ebfb267a4935007168f6256ec6d75c11633705252c55f489857437e08a2ebf3b7a7c40c000275e7fff9f0025ffa"
)

bz.fromHex(
  c0 = "0x0da4dec3fa76cb905c071a13a1d2c39906ce502d70085744df48985140be37fa6bd1ffdac407fff27608dfffde60fedc",
  c1 = "0x0df55883b636e29344071a7aa255dc6d25a258126bbe0a455b48985753c4377aeaf3a3f6c40c00027307ffb7ffbdefdc"
)

cx.fromHex(
  c0 = "0x11fcc7014aee3c2f1ead04bd25d8996fd29a1d71002e97bdca6d881d13ad1d937ff6ee83c8025feed202fffffbdcfffe",
  c1 = "0x09ee82982d80b1c7bf3e69b228ee461c30bce73d574478841da0bd7941294503292b7809222bfe7d4606f976400244d2"
)

cz.fromHex(
  c0 = "0x09ee82982d80b1c7bf3e69b228ee461c30bce73d574478841da0bd7941294503292b7809222bfe7d4606f976400244d2",
  c1 = "0x15f35eab6e70e2922b85d257a256ec6d43794851f05257452de3965753474ca66bf3f923c10bfe022d07d7f60000fffb"
)


doAssert bool a.trySetFromCoordsXandZ_debug(ax, az)
doAssert bool b.trySetFromCoordsXandZ_debug(bx, bz)
doAssert bool c.trySetFromCoordsXandZ_debug(cx, cz)

echo "a.x: ", a.x.toHex()
echo "a.y: ", a.y.toHex()
echo "a.z: ", a.z.toHex()
echo ""
echo "b.x: ", b.x.toHex()
echo "b.y: ", b.y.toHex()
echo "b.z: ", b.z.toHex()
echo ""
echo "c.x: ", c.x.toHex()
echo "c.y: ", c.y.toHex()
echo "c.z: ", c.z.toHex()

var tmp1{.noInit.}, tmp2{.noInit.}: ECP_SWei_Proj[Fp2[BLS12_381]]

# r0 = (a + b) + c
tmp1.sum(a, b)
tmp2.sum(tmp1, c)
let r0 = tmp2

# r1 = a + (b + c)
tmp1.sum(b, c)
tmp2.sum(a, tmp1)
let r1 = tmp2

# r2 = (a + c) + b
tmp1.sum(a, c)
tmp2.sum(tmp1, b)
let r2 = tmp2

# r3 = a + (c + b)
tmp1.sum(c, b)
tmp2.sum(a, tmp1)
let r3 = tmp2

# r4 = (c + a) + b
tmp1.sum(c, a)
tmp2.sum(tmp1, b)
let r4 = tmp2

# ...

doAssert bool(r0 == r1)
doAssert bool(r0 == r2)
doAssert bool(r0 == r3)
doAssert bool(r0 == r4)
P.y: Fp2(c0: 0x120dbe5ca6ec0769dda90bac03a42c27ffe46cfccaf61a66791de2e650d3f43f22d562853371e9e868dadba553e3aed8, c1: 0x0b377fc92bdd2d97ca38fb9f428fe092007c6c886672d48c8a833e15ab2b9ea6a8511db3d2be566585ea62005a40fe31)
P.y.isSquare: true
P.y.wasSquare: true
P.y: Fp2(c0: 0x05af52f65461f4255c7f977f3c46ae9aed4a4118d00db01ef65bce692bf4c77d5d359769af9259d9e1b0bb7c60fd174d, c1: 0x0b3ba68ed30db92744416d5e871d530ae918145a21fe73ce0bb9076ba784fe3e5f94369f91fb6fa961e4d37cf60905b4)
P.y.isSquare: true
P.y.wasSquare: true
P.y: Fp2(c0: 0x006b7a8f365b13ee0976b8af0af88f94afb80cd7b3e25e830d11da706a39dee9bcd8be64673b01c57df3655831c61cec, c1: 0x0b08dc0a88e9e38503004149dd4f2d823466b6934b2fef39ca2a7812935e74d28dd1824e2e4059d2e24ce5c9c76ab3bb)
P.y.isSquare: true
P.y.wasSquare: true
a.x: Fp2(c0: 0x1172a5b2a2adf5595988e1494780cf339b76b659bc79369a4198c3cb4198c322552d25452f163acab533ad886313d521, c1: 0x1339ccf93e7918bfaf29ec009b160580beb282f298b73c1975c8a502cd8fd50c562af936c97d288c873c93898a8b0381)
a.y: Fp2(c0: 0x0ca09b061afb3125a8767adcface64cd726f0badb6b0b7828ea6d4f68dc82e08d130df3721a721c3f0ad578a4366f551, c1: 0x0ab6755f2b1b31f52119c9112911eef23ed6c20229d19a9661c2d43ae1f31f228ac1140dc3b2e9c78b6d568f256fe910)
a.z: Fp2(c0: 0x15f65ec3fa7ce4935c071a97a256ec6d77ce385370513744df48944613b748b2a8e3bfdb035bfb7a7608ffc00002ff7c, c1: 0x15f646c3fa80e4835bd70a57a196ac6d57ce1653705247455f48983753c758bae9f3800ba3ebeff024c8cbd78002fdfc)

b.x: Fp2(c0: 0x05dd75183a66e6c8c72e5591ad2a26a994cf9d5f21a26bcd070530d41dfd3d5555ad8e691c5870e6caa53d819d347ac5, c1: 0x063d2e47437f947b1ae0c515eaace25a754a442a605cade51ae6d5bc85d15906100aa3e0d06389ec39d83db4242653e7)
b.y: Fp2(c0: 0x02bc5b99bd736e349eec338c34321b52568393918ccba4e24efd7477992756d88066a4e29f694e1fe3c62d265c278428, c1: 0x09cf0ea6f6f731f05169ea11e822b2b853b8b8c327fb11d457da3e7df33ef41f1dba958f928659778038fcb40b28b685)
b.z: Fp2(c0: 0x0da4dec3fa76cb905c071a13a1d2c39906ce502d70085744df48985140be37fa6bd1ffdac407fff27608dfffde60fedc, c1: 0x0df55883b636e29344071a7aa255dc6d25a258126bbe0a455b48985753c4377aeaf3a3f6c40c00027307ffb7ffbdefdc)

c.x: Fp2(c0: 0x01d96899d32dcd452de0c645a777add2d486731fa010931a8027fad5da6ea9f7bb1319b6fde0630806a3815a25f5af13, c1: 0x0d8366a9d06950de8407bcdca0c267fa2d699095de988603c1e79e374d80e77fb62176b3701ea61c8947d210a8a135d9)
c.y: Fp2(c0: 0x1238d8e83002c281b4468abf13da0d7186ae814e9d9af2c91642e6481a94c9400543bc8d56480bc7b74e6b3b080ba764, c1: 0x06cbef37390be486d23651b4e5e4eb07ce5f09c822aa8b1d93fec62eb0156ffae21d51870b763194c30b39c1d2079342)
c.z: Fp2(c0: 0x09ee82982d80b1c7bf3e69b228ee461c30bce73d574478841da0bd7941294503292b7809222bfe7d4606f976400244d2, c1: 0x15f35eab6e70e2922b85d257a256ec6d43794851f05257452de3965753474ca66bf3f923c10bfe022d07d7f60000fffb)
..../Programming/Nim/constantine/build/debug_g2.nim(109) debug_g2
..../.choosenim/toolchains/nim-#devel/lib/system/assertions.nim(29) failedAssertImpl
..../.choosenim/toolchains/nim-#devel/lib/system/assertions.nim(22) raiseAssert
..../.choosenim/toolchains/nim-#devel/lib/system/fatal.nim(49) sysFatal
Error: unhandled exception: ..../Programming/Nim/constantine/build/debug_g2.nim(109, 10) `bool(r0 == r1)`  [AssertionDefect]
@mratsim mratsim added the bug 🪲 Something isn't working label Jun 20, 2020
@mratsim
Copy link
Owner Author

mratsim commented Jun 20, 2020

Also commit 0400187, seed 1592676115, BLS12-381 - 32-bit https://github.com/mratsim/constantine/runs/791167555#step:15:2057

image

Repro, 32-bit again

import
  # Standard library
  std/[unittest, times],
  # Internals
  ../constantine/config/[common, curves],
  ../constantine/[arithmetic, towers],
  ../constantine/io/[io_bigints, io_fields, io_towers],
  ../constantine/elliptic/[ec_weierstrass_affine, ec_weierstrass_projective]

proc trySetFromCoordsXandZ_debug*[F](P: var ECP_SWei_Proj[F], x, z: F): SecretBool =
  ## Try to create a point the elliptic curve
  ## Y²Z = X³ + aXZ² + bZ³ (projective coordinates)
  ## y² = x³ + a x + b     (affine coordinate)
  ## return true and update `P` if `x` leads to a valid point
  ## return false otherwise, in that case `P` is undefined.
  ##
  ## Note: Dedicated robust procedures for hashing-to-curve
  ##       will be provided, this is intended for testing purposes.
  P.y.curve_eq_rhs(x)

  echo "P.y: ", P.y.toHex()
  echo "P.y.isSquare: ", bool P.y.isSquare
  result = sqrt_if_square(P.y)
  echo "P.y.wasSquare: ", bool result

  P.x.prod(x, z)
  P.y *= z
  P.z = z

var a, b, c: ECP_SWei_Proj[Fp2[BLS12_381]]

var ax, az, bx, bz, cx, cz: Fp2[BLS12_381]
ax.fromHex(
  c0 = "0x0be65dc3f260e3814b86f997a256dc6cf5cbfc536ed257455f48985751c758b6d3efc005c38b00027588befff802fffc",
  c1 = "0x015802786d80b1c7e206290223e4440c40a8da49575c7cc40ca93b99392944fd084ba00124b2fdfde907000000025552"
)

az.fromHex(
  c0 = "0x13f1dcf37a53c48a5c071a972236ea6cebce5843674a5324542885d7098337b0e2ebe003b80bd801f588ffb7f55efbdb",
  c1 = "0x05b5dec1fa80e4935c05fa869055ec6cb5b64fc37051d74557088c4753c758baeb31fd03420ae00155fe7e000002fffb"
)

bx.fromHex(
  c0 = "0x0beb9e43fa1f34933c06ea5c9206536d67ce585330525744fe485756817f46ba53f3f00bc40c00027188ffeefbf2efe7",
  c1 = "0x15f65ebdf640e4525c051a976256ec6d778c185370524f3d5f48905741c6d829ebf3ff6ba34abfb87607fed3cfaabfa8"
)

bz.fromHex(
  c0 = "0x16fbb84711c0596bd3916126d2d0caa1da00b1bc116b70ff4938b574243aa76f754d5f05309fffa90ffbeff9e900b043",
  c1 = "0x13d2848256ff557fbd1601aa27b8f07384e7faca4ae18d030c55883a36d63b1f4778000757ff780163f57ffffffee469"
)

cx.fromHex(
  c0 = "0x15d0dd8bf97fe1eb37fe9a827a56e9665ace4bd168120cbd5b208e56f18f547aeaf2000b2289effa61fff7300002f7b9",
  c1 = "0x15f65ec3fa80e4832ec68a97a256ec6d734e27cee05257435ef898554cc748bae3cfda0b998277c27606bffdf202ff7c"
)

cz.fromHex(
  c0 = "0x05f61d97f970e1867be71a17a1d6e46d764e53ce7051d5455f4697d7139f54b8eb63f80bc40bfffe6e04fbffb5d2efba",
  c1 = "0x15f65ec3f63fe0115b9ee2871232dc63378e584b6fc95742d807184cbb4735faebf4000ac40afd727608dfef8002ff7c"
)


doAssert bool a.trySetFromCoordsXandZ_debug(ax, az)
doAssert bool b.trySetFromCoordsXandZ_debug(bx, bz)
doAssert bool c.trySetFromCoordsXandZ_debug(cx, cz)

echo "a.x: ", a.x.toHex()
echo "a.y: ", a.y.toHex()
echo "a.z: ", a.z.toHex()
echo ""
echo "b.x: ", b.x.toHex()
echo "b.y: ", b.y.toHex()
echo "b.z: ", b.z.toHex()
echo ""
echo "c.x: ", c.x.toHex()
echo "c.y: ", c.y.toHex()
echo "c.z: ", c.z.toHex()

var tmp1{.noInit.}, tmp2{.noInit.}: ECP_SWei_Proj[Fp2[BLS12_381]]

# r0 = (a + b) + c
tmp1.sum(a, b)
tmp2.sum(tmp1, c)
let r0 = tmp2

# r1 = a + (b + c)
tmp1.sum(b, c)
tmp2.sum(a, tmp1)
let r1 = tmp2

# r2 = (a + c) + b
tmp1.sum(a, c)
tmp2.sum(tmp1, b)
let r2 = tmp2

# r3 = a + (c + b)
tmp1.sum(c, b)
tmp2.sum(a, tmp1)
let r3 = tmp2

# r4 = (c + a) + b
tmp1.sum(c, a)
tmp2.sum(tmp1, b)
let r4 = tmp2

# ...

doAssert bool(r0 == r1)
doAssert bool(r0 == r2)
doAssert bool(r0 == r3)
doAssert bool(r0 == r4)

@mratsim
Copy link
Owner Author

mratsim commented Jun 20, 2020

image
seed 1592673399

https://github.com/mratsim/constantine/runs/791098558#step:13:577

Another sqrt issue

import
  # Standard library
  std/[unittest, times],
  # Internals
  ../constantine/config/[common, curves],
  ../constantine/[arithmetic, towers],
  ../constantine/io/[io_bigints, io_fields, io_towers],
  ../constantine/elliptic/[ec_weierstrass_affine, ec_weierstrass_projective]

proc trySetFromCoordsXandZ_debug*[F](P: var ECP_SWei_Proj[F], x, z: F): SecretBool =
  ## Try to create a point the elliptic curve
  ## Y²Z = X³ + aXZ² + bZ³ (projective coordinates)
  ## y² = x³ + a x + b     (affine coordinate)
  ## return true and update `P` if `x` leads to a valid point
  ## return false otherwise, in that case `P` is undefined.
  ##
  ## Note: Dedicated robust procedures for hashing-to-curve
  ##       will be provided, this is intended for testing purposes.
  P.y.curve_eq_rhs(x)

  echo "P.y: ", P.y.toHex()
  echo "P.y.isSquare: ", bool P.y.isSquare
  result = sqrt_if_square(P.y)
  echo "P.y.wasSquare: ", bool result

  P.x.prod(x, z)
  P.y *= z
  P.z = z

var a, b, c: ECP_SWei_Proj[Fp2[BLS12_381]]

var ax, az, bx, bz, cx, cz: Fp2[BLS12_381]
ax.fromHex(
  c0 = "0x0206c8357bce498e14724363fd8303be0d9dada03288450b75d7e38da4d271cfdd98c7235571ee58f63929cd6210a809",
  c1 = "0x0419d3333523d23a3a59181bb6c519d2d2aa0f83f51c6bd5b916d82447a02f6143894943f90dfc8faf0524016538e200"
)

az.fromHex(
  c0 = "0x0c0b324ebb784e2223657e1d54c37bebc453f55aa4dffa3e50bec37c95afa43e3e1e562d5c30f9360ec3710a486a6683",
  c1 = "0x141a351b0c423f0bb9680dba5047c3364013e4cc9d2b65f467436dabe92fa164a72f3ba98d387f9ba36fd687b6084ac0"
)

bx.fromHex(
  c0 = "0x00685bd1b3e4bd34518fb984b4387e0acc3844db814a1a86d0f0b8ea287e44c7894ee00ba0fdd4bef410982f39097613",
  c1 = "0x059d602ef0ff0406ab299c2024e6df7f243954df7fc948a9d5965adffe00b5108de49d3e2603e0415500fc1007078457"
)

bz.fromHex(
  c0 = "0x031bbb7e0ff9995ae2b7f223d4a8c536b0c1c8e08bd0720cd49242a516fc2e8749077b2b04b637b07d30499f5e1bacbf",
  c1 = "0x0e788191485934ff8b69796fa6103db6b203a6f3def033c9d0899f709fc8e298718afa0fcd7e6c973aec2e9a2a69bc0c"
)

cx.fromHex(
  c0 = "0x0ed6d4f86a8537338e041dd0b388f78dc15ebdc0da21487604f5485d3407c9830897b163e76e1c23fe92f3f4518e6396",
  c1 = "0x04e49e91837d18ed72fcd84b084200593814ab0cb8d3d5d8410c522f111b4c8e9c698fc188af2bfec0c5ebba48218571"
)

cz.fromHex(
  c0 = "0x13695be638f4c0c8cb845d25cf5e0439afb8216d1facf84abc1a3a3d138db644345f1a3214b3c22f7e7682829b1a2fe1",
  c1 = "0x0157a74d9903679d2ac4ef2bdf464238202d6984cb5adf74a4ed1d550d6b1e6a8ba7d41764561741e618c277a853bf93"
)


doAssert bool a.trySetFromCoordsXandZ_debug(ax, az)
doAssert bool b.trySetFromCoordsXandZ_debug(bx, bz)
doAssert bool c.trySetFromCoordsXandZ_debug(cx, cz)

echo "a.x: ", a.x.toHex()
echo "a.y: ", a.y.toHex()
echo "a.z: ", a.z.toHex()
echo ""
echo "b.x: ", b.x.toHex()
echo "b.y: ", b.y.toHex()
echo "b.z: ", b.z.toHex()
echo ""
echo "c.x: ", c.x.toHex()
echo "c.y: ", c.y.toHex()
echo "c.z: ", c.z.toHex()

var tmp1{.noInit.}, tmp2{.noInit.}: ECP_SWei_Proj[Fp2[BLS12_381]]

# r0 = (a + b) + c
tmp1.sum(a, b)
tmp2.sum(tmp1, c)
let r0 = tmp2

# r1 = a + (b + c)
tmp1.sum(b, c)
tmp2.sum(a, tmp1)
let r1 = tmp2

# r2 = (a + c) + b
tmp1.sum(a, c)
tmp2.sum(tmp1, b)
let r2 = tmp2

# r3 = a + (c + b)
tmp1.sum(c, b)
tmp2.sum(a, tmp1)
let r3 = tmp2

# r4 = (c + a) + b
tmp1.sum(c, a)
tmp2.sum(tmp1, b)
let r4 = tmp2

# ...

doAssert bool(r0 == r1)
doAssert bool(r0 == r2)
doAssert bool(r0 == r3)
doAssert bool(r0 == r4)
P.y: Fp2(c0: 0x0e2b04d9349fbfc84af25575023840ffd7796f12b178b6fadb14170c9dcd1bd6848af5d15b9c8cfe09a3f30cc17f4dca, c1: 0x0b22a65c9abc2e2a621a4aee6fef7fa79edaa87d444dad52db595861456d03527fcb5d2c24f993ca0c84ac0f7d938787)
P.y.isSquare: true
P.y.wasSquare: true
P.y: Fp2(c0: 0x01369d4c5c167fda2a5d9aa1205bedd3dabc746eb94f1d0561940fb5a989b729f3999695ff203bac738c6a3b4b567b05, c1: 0x0267d9f89b8e0caf30993c49a82ba2896895ae25273911150fce576db841e29513e2030cc6c460efb72b8cc56ba37e77)
P.y.isSquare: true
P.y.wasSquare: true
P.y: Fp2(c0: 0x061bd0f645de26f928386c9393711ba30cabcee5b493f1c3502b33d1cf4e80ed6a9433fe51ec48ce3b28fa748a5cbf93, c1: 0x105eddcc7fca28805a016b5a01723c632bad32dd8d5de66457dfe73807e226772e653b3e37c3dea0248f98847efa9a85)
P.y.isSquare: false
P.y.wasSquare: true
a.x: Fp2(c0: 0x00dd35a529dd04ef8a4253c4785c0677693e66e1043e93b4b20c2d8ccf99d5ce02f04f86e8720072a43c2602c4c9140a, c1: 0x12defcc8a77535d672ebd45c8147d7c40a0bab8f76aa3c146f447746e79db8cc0cbb202d18d946461fd1f557ac2dd3b3)
a.y: Fp2(c0: 0x14f7f1f5254d2686d2015cd09526fce713f301d2fb679635c3896b21e3aad69125f787f3742627cf66e8c47d44b37bb5, c1: 0x0159cfbff9a4a1e749abc610d6ab9e6433cdfcbf83fa1360bd141fbcb5b2b91676ec19b1256f4fdd4b6f0f7ba7f1d36b)
a.z: Fp2(c0: 0x0c0b324ebb784e2223657e1d54c37bebc453f55aa4dffa3e50bec37c95afa43e3e1e562d5c30f9360ec3710a486a6683, c1: 0x141a351b0c423f0bb9680dba5047c3364013e4cc9d2b65f467436dabe92fa164a72f3ba98d387f9ba36fd687b6084ac0)

b.x: Fp2(c0: 0x0eda3b7661c3951c109940b569cda34e97f3e13eee72baf0bd336c122b636a581d708b1723ca19e7ebb1623c8722f5f2, c1: 0x123d850822ef83fcfa6b30106e5ae2c6e86fdf1c77ae8598427aee31287931339915e3ec16308ed89a5b3cd7d1e21a7c)
b.y: Fp2(c0: 0x1516a7ab6851ccf35b6375bb7b5e5ced8a80e4d84099ef0d13adf500b4e224983cdf07a65be8c7aa57d2b94ae590667a, c1: 0x19e3f323658394859ed4fd7146f29abe20726459d68477a311f5246d2e0c926071693a12176a696580e8803d5b258162)
b.z: Fp2(c0: 0x031bbb7e0ff9995ae2b7f223d4a8c536b0c1c8e08bd0720cd49242a516fc2e8749077b2b04b637b07d30499f5e1bacbf, c1: 0x0e788191485934ff8b69796fa6103db6b203a6f3def033c9d0899f709fc8e298718afa0fcd7e6c973aec2e9a2a69bc0c)

c.x: Fp2(c0: 0x1199d20d9635b2ebcf2fb9df481dd1533b95247e2fe69a400de287168ae96bac57775508e4604bd01f272d7fe09ca37e, c1: 0x1703ffc3743d43f32a5f04ff8f3c39f924422479ad58967d810cef0c1243cdfc8ca3e845f545b02d28f8247ca38759a1)
c.y: Fp2(c0: 0x076e36b794020184cdfdb5a237a516937f972c7d6ea4dafe313335f544f1f112dc93838217ea6604cb1163a5ec6ed887, c1: 0x08a3ecbddcaa1cd6916ac33039213261bf6c1c9874b2aa4b6e56dbf318c93c690a84a98f7a0d601bd4fedc9dc8f53b1b)
c.z: Fp2(c0: 0x13695be638f4c0c8cb845d25cf5e0439afb8216d1facf84abc1a3a3d138db644345f1a3214b3c22f7e7682829b1a2fe1, c1: 0x0157a74d9903679d2ac4ef2bdf464238202d6984cb5adf74a4ed1d550d6b1e6a8ba7d41764561741e618c277a853bf93)

mratsim added a commit that referenced this issue Jun 21, 2020
mratsim added a commit that referenced this issue Jun 21, 2020
mratsim added a commit that referenced this issue Jun 21, 2020
@mratsim mratsim mentioned this issue Jun 22, 2020
2 tasks
@mratsim mratsim linked a pull request Jun 22, 2020 that will close this issue
2 tasks
mratsim added a commit that referenced this issue Jun 22, 2020
* Add test case for #30 - Euler's criterion doesn't return 1 for a square

* Detect #42 in the test suite

* Detect #43 in the test suite

* comment in sqrt tests

* Add #67 to the anti-regression suite

* Add #61 to the anti-regression suite

* Add #62 to anti-regression suite

* Add #60 to the anti-regression suite

* Add #64 to the test suite

* Add #65 - case 1

* Add #65 case 2

* Add #65 case 3

* Add debug check to isSquare/Euler's Criterion/Legendre Symbol

* Make sure our primitives are correct

* For now deactivate montySquare CIOS fix #61 #62

* Narrow down #42 and #43 to powinv on 32-bit

* Detect #42 #43 at the fast squaring level

* More #42, #43 tests, Use multiplication instead of squaring as a temporary workaround, see #68

* Prevent regression of #67 now that squaring is "fixed"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working has repro 🎯
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant