error 0 crypto_encrypt_open does not handle c=t overlap ==11543== Memcheck, a memory error detector ==11543== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==11543== Using Valgrind-3.15.0.GIT and LibVEX; rerun with -h for copyright info ==11543== Command: ./try ==11543== ==11543== Warning: client switching stacks? SP change: 0x1ffeffff28 --> 0x1ffedddf18 ==11543== to suppress, use: --max-stackframe=2236432 or greater ==11543== Invalid write of size 8 ==11543== at 0x402246: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== Address 0x1ffedddf18 is on thread 1's stack ==11543== ==11543== Invalid write of size 2 ==11543== at 0x402A07: unpack_128elems (pack.c:84) ==11543== by 0x403401: sample_uniform (sampler.c:163) ==11543== by 0x4034B6: lotus_cpa_pke_keypair (cpa-pke.c:49) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee45f20 is on thread 1's stack ==11543== in frame #3, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x402A28: unpack_128elems (pack.c:85) ==11543== by 0x403401: sample_uniform (sampler.c:163) ==11543== by 0x4034B6: lotus_cpa_pke_keypair (cpa-pke.c:49) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee45f40 is on thread 1's stack ==11543== in frame #3, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x402A48: unpack_128elems (pack.c:86) ==11543== by 0x403401: sample_uniform (sampler.c:163) ==11543== by 0x4034B6: lotus_cpa_pke_keypair (cpa-pke.c:49) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee45f60 is on thread 1's stack ==11543== in frame #3, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x402A68: unpack_128elems (pack.c:87) ==11543== by 0x403401: sample_uniform (sampler.c:163) ==11543== by 0x4034B6: lotus_cpa_pke_keypair (cpa-pke.c:49) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee45f80 is on thread 1's stack ==11543== in frame #3, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x402A8B: unpack_128elems (pack.c:88) ==11543== by 0x403401: sample_uniform (sampler.c:163) ==11543== by 0x4034B6: lotus_cpa_pke_keypair (cpa-pke.c:49) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee45fa0 is on thread 1's stack ==11543== in frame #3, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x402ABB: unpack_128elems (pack.c:89) ==11543== by 0x403401: sample_uniform (sampler.c:163) ==11543== by 0x4034B6: lotus_cpa_pke_keypair (cpa-pke.c:49) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee45fc0 is on thread 1's stack ==11543== in frame #3, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x402B12: unpack_128elems (pack.c:90) ==11543== by 0x403401: sample_uniform (sampler.c:163) ==11543== by 0x4034B6: lotus_cpa_pke_keypair (cpa-pke.c:49) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee45fe0 is on thread 1's stack ==11543== in frame #3, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x402B5E: unpack_128elems (pack.c:95) ==11543== by 0x403401: sample_uniform (sampler.c:163) ==11543== by 0x4034B6: lotus_cpa_pke_keypair (cpa-pke.c:49) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee46000 is on thread 1's stack ==11543== in frame #3, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x402BAE: unpack_128elems (pack.c:98) ==11543== by 0x403401: sample_uniform (sampler.c:163) ==11543== by 0x4034B6: lotus_cpa_pke_keypair (cpa-pke.c:49) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee46010 is on thread 1's stack ==11543== in frame #3, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x40345B: sample_discrete_gaussian (sampler.c:176) ==11543== by 0x4034CA: lotus_cpa_pke_keypair (cpa-pke.c:53) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffedddf20 is on thread 1's stack ==11543== in frame #2, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid write of size 2 ==11543== at 0x40345B: sample_discrete_gaussian (sampler.c:176) ==11543== by 0x4034DF: lotus_cpa_pke_keypair (cpa-pke.c:54) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffef97f20 is on thread 1's stack ==11543== in frame #2, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid read of size 2 ==11543== at 0x403860: submul (lwe-arithmetics.c:18) ==11543== by 0x4034ED: lotus_cpa_pke_keypair (cpa-pke.c:56) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffedddf20 is on thread 1's stack ==11543== in frame #2, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid read of size 2 ==11543== at 0x403863: submul (lwe-arithmetics.c:18) ==11543== by 0x4034ED: lotus_cpa_pke_keypair (cpa-pke.c:56) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffee45f20 is on thread 1's stack ==11543== in frame #2, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid read of size 2 ==11543== at 0x403869: submul (lwe-arithmetics.c:17) ==11543== by 0x4034ED: lotus_cpa_pke_keypair (cpa-pke.c:56) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffef97f20 is on thread 1's stack ==11543== in frame #2, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== Invalid read of size 2 ==11543== at 0x403877: submul (lwe-arithmetics.c:16) ==11543== by 0x4034ED: lotus_cpa_pke_keypair (cpa-pke.c:56) ==11543== by 0x40224A: crypto_encrypt_lotus256_ref_keypair (encrypt.c:32) ==11543== by 0x401383: test (try.c:108) ==11543== by 0x401EB2: main (try-anything.c:295) ==11543== Address 0x1ffedddf24 is on thread 1's stack ==11543== in frame #2, created by crypto_encrypt_lotus256_ref_keypair (encrypt.c:27) ==11543== ==11543== ==11543== More than 10000000 total errors detected. I'm not reporting any more. ==11543== Final error counts will be inaccurate. Go fix your program! ==11543== Rerun with --error-limit=no to disable this cutoff. Note ==11543== that errors may occur in your program without prior warning from ==11543== Valgrind, because errors are no longer being displayed. ==11543== ==11543== Warning: client switching stacks? SP change: 0x1ffedddf20 --> 0x1ffeffff28 ==11543== to suppress, use: --max-stackframe=2236424 or greater ==11543== Warning: client switching stacks? SP change: 0x1ffeffff18 --> 0x1ffeddcda0 ==11543== to suppress, use: --max-stackframe=2240888 or greater ==11543== further instances of this message will not be shown. ==11543== ==11543== HEAP SUMMARY: ==11543== in use at exit: 16,310,192 bytes in 12 blocks ==11543== total heap usage: 2,118 allocs, 2,106 frees, 16,418,976 bytes allocated ==11543== ==11543== LEAK SUMMARY: ==11543== definitely lost: 0 bytes in 0 blocks ==11543== indirectly lost: 0 bytes in 0 blocks ==11543== possibly lost: 16,309,760 bytes in 10 blocks ==11543== still reachable: 432 bytes in 2 blocks ==11543== suppressed: 0 bytes in 0 blocks ==11543== Rerun with --leak-check=full to see details of leaked memory ==11543== ==11543== For lists of detected and suppressed errors, rerun with: -s ==11543== ERROR SUMMARY: 10000000 errors from 16 contexts (suppressed: 0 from 0)